Skip to content

Commit

Permalink
pass the build qualifier to the build script
Browse files Browse the repository at this point in the history
VN-3066
  • Loading branch information
jochenkemnade committed May 23, 2022
1 parent 238d089 commit 405b91d
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
def qualifier

pipeline {
agent {
dockerfile {
Expand Down Expand Up @@ -29,6 +31,8 @@ pipeline {
stage('Setup') {
steps {
script {
qualifier = "v${new Date().format('yyyyMMddHHmmss')}"
echo "Using build qualifier $qualifier"
if (params.distSign && !params.dists) {
def msg = 'You have to enable dists, if you want to sign packages.'
buildDescription msg
Expand All @@ -50,19 +54,19 @@ pipeline {
}
}
buildDescription "${env.GIT_BRANCH} ${env.GIT_COMMIT[0..8]}"
sh './verinice-distribution/build.sh clean'
sh "./verinice-distribution/build.sh QUALIFIER=${qualifier} clean"
}
}
stage('Fetch JREs') {
steps {
sh "./verinice-distribution/build.sh JREVERSION=${params.jreversion} -j4 jres"
sh "./verinice-distribution/build.sh QUALIFIER=${qualifier} JREVERSION=${params.jreversion} -j4 jres"
}
}
stage('Build') {
steps {
script {
def buildTask = params.runIntegrationTests ? 'verify' : 'products'
sh "./verinice-distribution/build.sh ${buildTask}"
sh "./verinice-distribution/build.sh QUALIFIER=${qualifier} ${buildTask}"
archiveArtifacts artifacts: 'sernet.verinice.releng.client.product/target/products/*.zip,sernet.verinice.releng.server.product/target/*.war', fingerprint: true
if (params.archiveUpdateSite || params.dists){
archiveArtifacts artifacts: 'sernet.verinice.releng.client.product/target/repository/**', fingerprint: true
Expand Down Expand Up @@ -112,7 +116,7 @@ pipeline {
}
stage('Documentation') {
steps {
sh "./verinice-distribution/build.sh -j4 docs"
sh "./verinice-distribution/build.sh QUALIFIER=${qualifier} -j4 docs"
archiveArtifacts artifacts: 'doc/manual/*/*.pdf,doc/manual/*/*.zip', fingerprint: true
}
}
Expand All @@ -135,7 +139,7 @@ pipeline {
expression { params.dists && currentBuild.result in [null, 'SUCCESS'] }
}
steps {
sh "./verinice-distribution/build.sh -j2 dists"
sh "./verinice-distribution/build.sh QUALIFIER=${qualifier} -j2 dists"
}
}
// Signing is a separate step because we want to be able to build RPMs any time, to test them.
Expand All @@ -160,7 +164,7 @@ pipeline {
emailext body: '${JELLY_SCRIPT,template="text"}', subject: '$DEFAULT_SUBJECT', to: '[email protected], [email protected], [email protected], [email protected], [email protected]'
}
success {
sh './verinice-distribution/build.sh clean'
sh './verinice-distribution/build.sh QUALIFIER=${qualifier} clean'
}
}
}
Expand Down

0 comments on commit 405b91d

Please sign in to comment.