Skip to content

Commit

Permalink
tidy up Jenkinsfile
Browse files Browse the repository at this point in the history
  • Loading branch information
joker234 committed Oct 31, 2023
1 parent 85a32b0 commit ef27a0d
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
pipeline {
agent { label 'worker' }
agent {
label 'worker'
}
options {
timeout(time: 30, unit: 'MINUTES')
}
Expand All @@ -11,6 +13,7 @@ pipeline {
// START CUSTOM ohsome API
MAVEN_TEST_OPTIONS = '-Dport_get=8081 -Dport_post=8082 -Dport_data=8083 -DdbFilePathProperty=--database.db=/data/heidelberg-v1.0-beta.oshdb'
// END CUSTOM ohsome API
// this regex determines which branch is deployed as a snapshot
SNAPSHOT_BRANCH_REGEX = /(^master$)/
RELEASE_REGEX = /^([0-9]+(\.[0-9]+)*)(-(RC|beta-|alpha-)[0-9]+)?$/
RELEASE_DEPLOY = false
Expand Down Expand Up @@ -47,9 +50,11 @@ pipeline {
}
steps {
deploy_snapshot('clean compile javadoc:jar source:jar deploy -P sign,git')
// START CUSTOM ohsome API
script {
SNAPSHOT_DEPLOY = true
}
// END CUSTOM ohsome API
}
post {
failure {
Expand All @@ -68,9 +73,11 @@ pipeline {
deploy_release('clean compile javadoc:jar source:jar deploy -P sign,git')

deploy_release_central('clean compile javadoc:jar source:jar deploy -P sign,git,deploy-central')
// START CUSTOM ohsome API
script {
RELEASE_DEPLOY = true
}
// END CUSTOM ohsome API
}
post {
failure {
Expand Down Expand Up @@ -151,7 +158,7 @@ pipeline {
when {
expression {
if (currentBuild.number > 1) {
return (((currentBuild.getStartTimeInMillis() - currentBuild.previousBuild.getStartTimeInMillis()) > 2592000000000) && (env.BRANCH_NAME ==~ SNAPSHOT_BRANCH_REGEX)) //2592000000000 one month in milliseconds
return (((currentBuild.getStartTimeInMillis() - currentBuild.previousBuild.getStartTimeInMillis()) > 2592000000) && (env.BRANCH_NAME ==~ SNAPSHOT_BRANCH_REGEX)) //2592000000 30 days in milliseconds
}
return false
}
Expand All @@ -168,4 +175,4 @@ pipeline {
}
}
}
}
}

0 comments on commit ef27a0d

Please sign in to comment.