Override CI_COMMIT_REF_SLUG for QA branches

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 <remy@rymai.me>
This commit is contained in:
Rémy Coutable 2018-11-26 10:34:44 +01:00
parent ba77dd3f3f
commit 17756db81d
No known key found for this signature in database
GPG Key ID: 98DFFD1C0C62B70B
1 changed files with 7 additions and 1 deletions

View File

@ -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