Skip to content

Commit

Permalink
feat: allow to run it for other branches/PR/tags (elastic#18978)
Browse files Browse the repository at this point in the history
  • Loading branch information
kuisathaverat authored and melchiormoulin committed Oct 14, 2020
1 parent 3b87cb3 commit 09638a8
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 7 deletions.
13 changes: 7 additions & 6 deletions .ci/build-docker-images.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -31,17 +31,18 @@ pipeline {
}
parameters {
booleanParam(name: "RELEASE_TEST_IMAGES", defaultValue: "true", description: "If it's needed to build & push Beats' test images")
string(name: 'BRANCH_REFERENCE', defaultValue: "master", description: "Git branch/tag to use")
}
stages {
stage('Checkout') {
steps {
gitCheckout(basedir: "${BASE_DIR}",
branch: "${params.BRANCH_REFERENCE}",
repo: "https://github.com/elastic/${REPO}.git",
credentialsId: "${JOB_GIT_CREDENTIALS}"
)
dir("${BASE_DIR}"){
git("https://github.com/elastic/${REPO}.git")
}
script {
dir("${BASE_DIR}"){
env.GO_VERSION = readFile(".go-version").trim()
}
setEnvVar("GO_VERSION", readFile(".go-version").trim())
}
}
}
Expand Down
7 changes: 6 additions & 1 deletion .ci/jobs/build-it-docker-images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@
description: Job to pre-build docker images used in integration tests.
view: Beats
project-type: pipeline
parameters:
- string:
name: BRANCH_REFERENCE
default: master
description: the Git branch specifier
pipeline-scm:
script-path: .ci/build-docker-images.groovy
scm:
Expand All @@ -17,6 +22,6 @@
credentials-id: f6c7695a-671e-4f4f-a331-acdce44ff9ba
reference-repo: /var/lib/jenkins/.git-references/beats.git
branches:
- 'master'
- $BRANCH_REFERENCE
triggers:
- timed: 'H H(0-5) * * 1-5'

0 comments on commit 09638a8

Please sign in to comment.