Skip to content

Commit 6aebb7d

Browse files
Robert Marshallbalasankarc
andcommitted
Merge branch 'tag-qa-image-with-rails-ref' into 'master'
Tag QA image with auto-deploy rails ref tag format Closes #7068 See merge request https://gitlab.com/gitlab-org/omnibus-gitlab/-/merge_requests/6307 Merged-by: Robert Marshall <[email protected]> Approved-by: Robert Marshall <[email protected]> Co-authored-by: Balasankar "Balu" C <[email protected]>
2 parents cdce031 + ad9a200 commit 6aebb7d

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

lib/gitlab/tasks/qa.rake

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,19 @@ namespace :qa do
3030
desc "Push unstable or auto-deploy version of gitlab-{ce,ee}-qa to the GitLab registry"
3131
task :staging do
3232
Gitlab::Util.section('qa:push:staging') do
33-
tag = Build::Check.is_auto_deploy? ? Build::Info.major_minor_version_and_rails_ref : Build::Info.gitlab_version
34-
Build::QAImage.tag_and_push_to_gitlab_registry(tag)
33+
if Build::Check.is_auto_deploy?
34+
# Tag using both major.minor-railsref tag and just railsref tag.
35+
# Temporary until gitlab-qa is changed to detect QA image tag from just railsref.
36+
# https://gitlab.com/gitlab-org/gitlab-qa/-/issues/687
37+
major_minor_version_and_rails_ref = Build::Info.major_minor_version_and_rails_ref
38+
rails_ref = major_minor_version_and_rails_ref.match(/^(?<major>\d+)\.(?<minor>\d+)-(?<railsref>\w+)$/)['railsref']
39+
40+
Build::QAImage.tag_and_push_to_gitlab_registry(major_minor_version_and_rails_ref)
41+
Build::QAImage.tag_and_push_to_gitlab_registry(rails_ref)
42+
else
43+
Build::QAImage.tag_and_push_to_gitlab_registry(Build::Info.gitlab_version)
44+
end
45+
3546
Build::QAImage.tag_and_push_to_gitlab_registry(Build::Info.commit_sha)
3647
end
3748
end

spec/lib/gitlab/tasks/qa_spec.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@
107107
allow(Build::Info).to receive(:current_git_tag).and_return('12.0.12345+5159f2949cb.59c9fa631')
108108

109109
expect(Build::QAImage).to receive(:tag_and_push_to_gitlab_registry).with('12.0-5159f2949cb')
110+
expect(Build::QAImage).to receive(:tag_and_push_to_gitlab_registry).with('5159f2949cb')
110111
expect(Build::QAImage).to receive(:tag_and_push_to_gitlab_registry).with(commit_sha)
111112

112113
Rake::Task['qa:push:staging'].invoke

0 commit comments

Comments
 (0)