All checks were successful
GiteaTest/JenkinsDotNETTest/pipeline/head This commit looks good
48 lines
2.3 KiB
Plaintext
48 lines
2.3 KiB
Plaintext
pipeline {
|
|
agent { label 'linux' }
|
|
options {
|
|
buildDiscarder(logRotator(numToKeepStr: '10', artifactNumToKeepStr: '10'))
|
|
}
|
|
stages {
|
|
stage('Build') {
|
|
steps {
|
|
withDotNet(sdk: '3.1') {
|
|
//Release SelfContained singlefile
|
|
dotnetPublish configuration: 'Release', outputDirectory: 'bin_SelfContained/', project: 'JenkinsDotNETTest.sln', properties: [PublishSingleFile: 'true'], runtime: 'linux-x64', selfContained: true
|
|
|
|
//Release SelfContained seprate files (disabled)
|
|
//dotnetPublish configuration: 'Release', outputDirectory: 'bin_SelfContained/', project: 'JenkinsDotNETTest.sln', runtime: 'linux-x64', selfContained: true
|
|
|
|
//Release for use with existing installed dotnet framework
|
|
dotnetPublish configuration: 'Release', outputDirectory: 'bin/', project: 'JenkinsDotNETTest.sln', selfContained: false
|
|
}
|
|
// Archive Build file
|
|
// Local
|
|
archiveArtifacts artifacts: "bin_SelfContained/**", onlyIfSuccessful: true
|
|
//Remote sftp server
|
|
//sshPublisher(publishers: [sshPublisherDesc(configName: 'centnas', transfers: [sshTransfer(cleanRemote: false, excludes: '', execCommand: '', execTimeout: 120000, flatten: false, makeEmptyDirs: false, noDefaultExcludes: false, patternSeparator: '[, ]+', remoteDirectory: '/$JOB_NAME', remoteDirectorySDF: false, removePrefix: '', sourceFiles: 'HelloWorld-amd64*')], usePromotionTimestamp: false, useWorkspaceInPromotion: false, verbose: false)])
|
|
// Cleaning WorkSpace
|
|
cleanWs()
|
|
}
|
|
}
|
|
}
|
|
post {
|
|
success {
|
|
echo 'Build successful'
|
|
}
|
|
failure {
|
|
echo 'Build Failed'
|
|
// Send To person to make commit
|
|
//emailext body: '$DEFAULT_CONTENT', recipientProviders: [culprits()], subject: '$DEFAULT_SUBJECT'
|
|
|
|
// Send To static addres
|
|
emailext attachLog: true,body: '$DEFAULT_CONTENT', subject: '$DEFAULT_SUBJECT', to: 'bram@bprieshof.nl'
|
|
}
|
|
unstable {
|
|
echo 'Build unstable'
|
|
}
|
|
changed {
|
|
echo 'Pipeline has changed'
|
|
}
|
|
}
|
|
} |