Skip to content
This repository has been archived by the owner on Sep 17, 2024. It is now read-only.

Commit

Permalink
chore: add parameter in the pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
mdelapenya committed Apr 27, 2021
1 parent 8f5e203 commit c10e38f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
10 changes: 9 additions & 1 deletion .ci/build-docker-images.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,23 @@ pipeline {
rateLimitBuilds(throttle: [count: 60, durationName: 'hour', userBoost: true])
quietPeriod(10)
}
parameters {
string(name: 'branch_specifier', defaultValue: 'master', description: 'It would not be defined on the first build, see JENKINS-41929.')
}
triggers {
cron 'H H(4-5) * * 1-5'
}
stages {
stage('Checkout') {
environment {
// Parameters will be empty for the very first build, setting an environment variable
// with the same name will workaround the issue. see JENKINS-41929
BRANCH_SPECIFIER = "${params?.branch_specifier}"
}
steps {
deleteDir()
gitCheckout(basedir: "${BASE_DIR}",
branch: "${params.BRANCH_REFERENCE}",
branch: "${env.BRANCH_SPECIFIER}",
repo: "https://github.com/elastic/${REPO}.git",
credentialsId: "${JOB_GIT_CREDENTIALS}"
)
Expand Down
7 changes: 1 addition & 6 deletions .ci/jobs/build-docker-images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,6 @@
description: Job to pre-build docker images used in E2E tests.
view: Beats
project-type: pipeline
parameters:
- string:
name: branch_specifier
default: master
description: the Git branch specifier to build
pipeline-scm:
script-path: .ci/build-docker-images.groovy
scm:
Expand All @@ -22,4 +17,4 @@
credentials-id: f6c7695a-671e-4f4f-a331-acdce44ff9ba
reference-repo: /var/lib/jenkins/.git-references/e2e-testing.git
branches:
- $branch_specifier
- master

0 comments on commit c10e38f

Please sign in to comment.