From 17756db81dfec9b2ed5b743181760e6192a0da6e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9my=20Coutable?= Date: Mon, 26 Nov 2018 10:34:44 +0100 Subject: [PATCH] Override CI_COMMIT_REF_SLUG for QA branches MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The `gitlab:assets:compile` job isn't run for the QA branches, thus there's no Docker image correspinding these branches in the registry. By overriding `CI_COMMIT_REF_SLUG` to `master` for QA branches, the `fetch-assets` job in the `omnibus-gitlab` pipeline will pull the `master` assets Docker image. Signed-off-by: Rémy Coutable --- scripts/trigger-build | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/scripts/trigger-build b/scripts/trigger-build index d02acd01a2a..d2c71f5be3e 100755 --- a/scripts/trigger-build +++ b/scripts/trigger-build @@ -106,12 +106,18 @@ module Trigger def extra_variables { 'GITLAB_VERSION' => ENV['CI_COMMIT_SHA'], - 'GITLAB_REF_SLUG' => ENV['CI_COMMIT_REF_SLUG'], + 'GITLAB_REF_SLUG' => ref_slug, 'ALTERNATIVE_SOURCES' => 'true', 'ee' => Trigger.ee? ? 'true' : 'false', 'QA_BRANCH' => ENV['QA_BRANCH'] || 'master' } end + + def ref_slug + return 'master' if ENV['CI_COMMIT_REF_SLUG'] =~ %r{(\Aqa[/-]|-qa\z)} + + ENV['CI_COMMIT_REF_SLUG'] + end end class CNG < Base