Skip to content

Commit

Permalink
[CI]: run packaging if ^go.mod changes (elastic#22383)
Browse files Browse the repository at this point in the history
  • Loading branch information
v1v authored Nov 9, 2020
1 parent af8eedd commit ac4a991
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ pipeline {
dir("${BASE_DIR}"){
// Skip all the stages except docs for PR's with asciidoc and md changes only
setEnvVar('ONLY_DOCS', isGitRegionMatch(patterns: [ '.*\\.(asciidoc|md)' ], shouldMatchAll: true).toString())
setEnvVar('GO_MOD_CHANGES', isGitRegionMatch(patterns: [ '^go.mod' ], shouldMatchAll: false).toString())
setEnvVar('GO_VERSION', readFile(".go-version").trim())
withEnv(["HOME=${env.WORKSPACE}"]) {
retryWithSleep(retries: 2, seconds: 5){ sh(label: "Install Go ${env.GO_VERSION}", script: '.ci/scripts/install-go.sh') }
Expand Down Expand Up @@ -122,6 +123,21 @@ pipeline {
}
}
}
stage('Packaging') {
agent none
options { skipDefaultCheckout() }
when {
allOf {
expression { return env.GO_MOD_CHANGES == "true" }
changeRequest()
}
}
steps {
withGithubNotify(context: 'Packaging') {
build(job: "Beats/packaging/${env.BRANCH_NAME}", propagate: true, wait: true)
}
}
}
}
post {
success {
Expand Down

0 comments on commit ac4a991

Please sign in to comment.