From 3be8e48266d45ab29d00aa869aee3ec6db6b5d36 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20de=20la=20Pe=C3=B1a?= Date: Tue, 27 Apr 2021 17:17:57 +0200 Subject: [PATCH] fix: branch_specifier is needed (#1097) * Revert "fix: update JJBB with proper values (#1093)" This reverts commit dddba263159f3fa8b30bd7f973d7e75ead6ce22b. * chore: change scheduled trigger * chore: rename to branch specifier * chore: fix indent * fix: keep parent folder name * fix: use proper git URL * chore: remove trigger from JJBB, using the one defined in the pipeline * chore: run pipeline from monday to friday, only * chore: add parameter in the pipeline * chore: normalise param name Co-authored-by: Victor Martinez Co-authored-by: Victor Martinez --- .ci/build-docker-images.groovy | 12 ++++++++++-- .ci/jobs/build-docker-images.yml | 2 -- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/.ci/build-docker-images.groovy b/.ci/build-docker-images.groovy index b93fd619b0..4fc12c886a 100644 --- a/.ci/build-docker-images.groovy +++ b/.ci/build-docker-images.groovy @@ -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(0-5) * * 1-5' + 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}" ) diff --git a/.ci/jobs/build-docker-images.yml b/.ci/jobs/build-docker-images.yml index 82e803aac1..17f9c4c49e 100644 --- a/.ci/jobs/build-docker-images.yml +++ b/.ci/jobs/build-docker-images.yml @@ -18,5 +18,3 @@ reference-repo: /var/lib/jenkins/.git-references/e2e-testing.git branches: - master - triggers: - - timed: 'H H(0-5) * * 1-5'