Skip to content

Commit

Permalink
placed build number check before time comp
Browse files Browse the repository at this point in the history
  • Loading branch information
ConstantinNicolai committed Oct 9, 2023
1 parent d86f480 commit f5aa9d4
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,11 @@ pipeline {

stage('Check Dependencies') {
when {
expression {
return (((currentBuild.getStartTimeInMillis() - currentBuild.previousBuild.getStartTimeInMillis()) > 2592000000000) && (currentBuild.number > 1) && (env.BRANCH_NAME ==~ SNAPSHOT_BRANCH_REGEX)) //2592000000000 one month in milliseconds
expression {
if (currentBuild.number > 1) {
return (((currentBuild.getStartTimeInMillis() - currentBuild.previousBuild.getStartTimeInMillis()) > 2592000000000) && (env.BRANCH_NAME ==~ SNAPSHOT_BRANCH_REGEX)) //2592000000000 one month in milliseconds
}
return false
}
}
steps {
Expand Down

0 comments on commit f5aa9d4

Please sign in to comment.