Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 17 additions & 12 deletions .ci/release/Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ pipeline {
PATH = "${env.JAVA_HOME}/bin:${env.PATH}"
SLACK_CHANNEL = '#apm-agent-java'
NOTIFY_TO = 'build-apm+apm-agent-java@elastic.co'
BRANCH_SPECIFIER = "${params.branch_specifier}"
}
options {
timeout(time: 3, unit: 'HOURS')
Expand All @@ -25,10 +26,9 @@ pipeline {

}
parameters {
string(name: 'branch_specifier', defaultValue: 'master')
booleanParam(name: 'check_branch_ci_status', defaultValue: true, description: "Check for failing tests in the master branch?")
string(name: 'branch_specifier', defaultValue: 'stable', description: "What branch to release from?")
booleanParam(name: 'check_branch_ci_status', defaultValue: true, description: "Check for failing tests in the given branch (if no stable branch)?")
}

stages {
stage('Initializing'){
options { skipDefaultCheckout() }
Expand All @@ -37,7 +37,7 @@ pipeline {
steps {
gitCheckout(
basedir: "${BASE_DIR}",
branch: 'master',
branch: "${BRANCH_SPECIFIER}",
repo: 'git@github.com:elastic/apm-agent-java.git',
credentialsId: 'f6c7695a-671e-4f4f-a331-acdce44ff9ba',
shallow: false
Expand Down Expand Up @@ -84,14 +84,19 @@ pipeline {
}
}
}
stage('Check master build status') {
when { expression { params.check_branch_ci_status } }
steps {
// If this build is not green: https://apm-ci.elastic.co/job/apm-agent-java/job/apm-agent-java-mbp/job/master/
whenTrue(!buildStatus(host: 'apm-ci.elastic.co', job: ['apm-agent-java', 'apm-agent-java-mbp', 'master'], return_boolean: true)) {
input(message: "WARNING! The master build is not passing. Do you wish to continue?")
}
}
stage('Check build status') {
when {
allOf {
expression { params.check_branch_ci_status }
not { branch 'stable' }
}
Comment on lines +89 to +92
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is no need to validate the stable. Besides, stable builds don't exist as a Jenkins Multibranch Pipeline since they are filtered in

head-filter-regex: '^(?!stable).*$'

}
steps {
// If this build is not green: https://apm-ci.elastic.co/job/apm-agent-java/job/apm-agent-java-mbp/job/"${BRANCH_SPECIFIER}"/
whenTrue(!buildStatus(host: 'apm-ci.elastic.co', job: ['apm-agent-java', 'apm-agent-java-mbp', "${BRANCH_SPECIFIER}"], return_boolean: true)) {
input(message: "WARNING! The ${BRANCH_SPECIFIER} build is not passing. Do you wish to continue?")
}
}
}
stage('Require confirmation that CHANGELOG.asciidoc has been updated') {
steps {
Expand Down