From 93420f50b1092ab719d373326505dead6e38546b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9my=20Coutable?= Date: Thu, 29 Nov 2018 10:49:30 +0100 Subject: Pass GITLAB_REF_SLUG to CNG triggered pipelines MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Rémy Coutable --- scripts/trigger-build | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'scripts/trigger-build') diff --git a/scripts/trigger-build b/scripts/trigger-build index d2c71f5be3e..14af3281106 100755 --- a/scripts/trigger-build +++ b/scripts/trigger-build @@ -68,6 +68,7 @@ module Trigger def base_variables { + 'GITLAB_REF_SLUG' => ref_slug, 'TRIGGERED_USER' => ENV['TRIGGERED_USER'] || ENV['GITLAB_USER_NAME'], 'TRIGGER_SOURCE' => ENV['CI_JOB_URL'], 'TOP_UPSTREAM_SOURCE_PROJECT' => ENV['CI_PROJECT_PATH'], @@ -76,6 +77,12 @@ module Trigger } end + def ref_slug + return 'master' if ENV['CI_COMMIT_REF_SLUG'] =~ %r{(\Aqa[/-]|-qa\z)} + + ENV['CI_COMMIT_REF_SLUG'] + end + # Read version files from all components def version_file_variables Dir.glob("*_VERSION").each_with_object({}) do |version_file, params| @@ -106,18 +113,11 @@ module Trigger def extra_variables { 'GITLAB_VERSION' => ENV['CI_COMMIT_SHA'], - '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 -- cgit v1.2.3