summaryrefslogtreecommitdiff
path: root/scripts/trigger-build.rb
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2022-09-19 23:18:09 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2022-09-19 23:18:09 +0000
commit6ed4ec3e0b1340f96b7c043ef51d1b33bbe85fde (patch)
treedc4d20fe6064752c0bd323187252c77e0a89144b /scripts/trigger-build.rb
parent9868dae7fc0655bd7ce4a6887d4e6d487690eeed (diff)
downloadgitlab-ce-6ed4ec3e0b1340f96b7c043ef51d1b33bbe85fde.tar.gz
Add latest changes from gitlab-org/gitlab@15-4-stable-eev15.4.0-rc42
Diffstat (limited to 'scripts/trigger-build.rb')
-rwxr-xr-xscripts/trigger-build.rb65
1 files changed, 5 insertions, 60 deletions
diff --git a/scripts/trigger-build.rb b/scripts/trigger-build.rb
index 57cc6a8551e..b368bbdb1f1 100755
--- a/scripts/trigger-build.rb
+++ b/scripts/trigger-build.rb
@@ -144,12 +144,10 @@ module Trigger
end
def base_variables
- # Use CI_MERGE_REQUEST_SOURCE_BRANCH_SHA for omnibus checkouts due to pipeline for merged results,
- # and fallback to CI_COMMIT_SHA for the `detached` pipelines.
{
'GITLAB_REF_SLUG' => ENV['CI_COMMIT_TAG'] ? ENV['CI_COMMIT_REF_NAME'] : ENV['CI_COMMIT_REF_SLUG'],
'TRIGGERED_USER' => ENV['TRIGGERED_USER'] || ENV['GITLAB_USER_NAME'],
- 'TOP_UPSTREAM_SOURCE_SHA' => Trigger.non_empty_variable_value('CI_MERGE_REQUEST_SOURCE_BRANCH_SHA') || ENV['CI_COMMIT_SHA']
+ 'TOP_UPSTREAM_SOURCE_SHA' => ENV['CI_COMMIT_SHA']
}
end
@@ -161,53 +159,6 @@ module Trigger
end
end
- class Omnibus < Base
- def self.access_token
- # Default to "Multi-pipeline (from 'gitlab-org/gitlab' 'package-and-qa' job)" at https://gitlab.com/gitlab-org/build/omnibus-gitlab-mirror/-/settings/access_tokens
- ENV['OMNIBUS_GITLAB_PROJECT_ACCESS_TOKEN'] || super
- end
-
- private
-
- def downstream_project_path
- ENV.fetch('OMNIBUS_PROJECT_PATH', 'gitlab-org/build/omnibus-gitlab-mirror')
- end
-
- def ref_param_name
- 'OMNIBUS_BRANCH'
- end
-
- def primary_ref
- 'master'
- end
-
- def trigger_stable_branch_if_detected?
- true
- end
-
- def extra_variables
- # Use CI_MERGE_REQUEST_SOURCE_BRANCH_SHA (MR HEAD commit) so that the image is in sync with the assets and QA images.
- # See https://docs.gitlab.com/ee/development/testing_guide/end_to_end/index.html#with-pipeline-for-merged-results.
- # We also set IMAGE_TAG so the GitLab Docker image is tagged with that SHA.
- source_sha = Trigger.non_empty_variable_value('CI_MERGE_REQUEST_SOURCE_BRANCH_SHA') || ENV['CI_COMMIT_SHA']
-
- {
- 'GITLAB_VERSION' => source_sha,
- 'IMAGE_TAG' => source_sha,
- 'QA_IMAGE' => ENV['QA_IMAGE'],
- 'SKIP_QA_DOCKER' => 'true',
- 'ALTERNATIVE_SOURCES' => 'true',
- 'SECURITY_SOURCES' => Trigger.security? ? 'true' : 'false',
- 'ee' => Trigger.ee? ? 'true' : 'false',
- 'QA_BRANCH' => ENV['QA_BRANCH'] || 'master',
- 'CACHE_UPDATE' => ENV['OMNIBUS_GITLAB_CACHE_UPDATE'],
- 'GITLAB_QA_OPTIONS' => ENV['GITLAB_QA_OPTIONS'],
- 'QA_TESTS' => ENV['QA_TESTS'],
- 'ALLURE_JOB_NAME' => ENV['ALLURE_JOB_NAME']
- }
- end
- end
-
class CNG < Base
def variables
# Delete variables that aren't useful when using native triggers.
@@ -232,14 +183,11 @@ module Trigger
end
def extra_variables
- # Use CI_MERGE_REQUEST_SOURCE_BRANCH_SHA (MR HEAD commit) so that the image is in sync with the assets and QA images.
- source_sha = Trigger.non_empty_variable_value('CI_MERGE_REQUEST_SOURCE_BRANCH_SHA') || ENV['CI_COMMIT_SHA']
-
{
"TRIGGER_BRANCH" => ref,
- "GITLAB_VERSION" => source_sha,
+ "GITLAB_VERSION" => ENV['CI_COMMIT_SHA'],
"GITLAB_TAG" => ENV['CI_COMMIT_TAG'], # Always set a value, even an empty string, so that the downstream pipeline can correctly check it.
- "GITLAB_ASSETS_TAG" => ENV['CI_COMMIT_TAG'] ? ENV['CI_COMMIT_REF_NAME'] : source_sha,
+ "GITLAB_ASSETS_TAG" => ENV['CI_COMMIT_TAG'] ? ENV['CI_COMMIT_REF_NAME'] : ENV['CI_COMMIT_SHA'],
"FORCE_RAILS_IMAGE_BUILDS" => 'true',
"CE_PIPELINE" => Trigger.ee? ? nil : "true", # Always set a value, even an empty string, so that the downstream pipeline can correctly check it.
"EE_PIPELINE" => Trigger.ee? ? "true" : nil # Always set a value, even an empty string, so that the downstream pipeline can correctly check it.
@@ -403,10 +351,9 @@ module Trigger
def extra_variables
{
- # Use CI_MERGE_REQUEST_SOURCE_BRANCH_SHA for omnibus checkouts due to pipeline for merged results
- # and fallback to CI_COMMIT_SHA for the `detached` pipelines.
'GITLAB_COMMIT_SHA' => Trigger.non_empty_variable_value('CI_MERGE_REQUEST_SOURCE_BRANCH_SHA') || ENV['CI_COMMIT_SHA'],
- 'TRIGGERED_USER_LOGIN' => ENV['GITLAB_USER_LOGIN']
+ 'TRIGGERED_USER_LOGIN' => ENV['GITLAB_USER_LOGIN'],
+ 'TOP_UPSTREAM_SOURCE_SHA' => Trigger.non_empty_variable_value('CI_MERGE_REQUEST_SOURCE_BRANCH_SHA') || ENV['CI_COMMIT_SHA']
}
end
@@ -482,8 +429,6 @@ end
if $0 == __FILE__
case ARGV[0]
- when 'omnibus'
- Trigger::Omnibus.new.invoke!(downstream_job_name: 'Trigger:qa-test').wait!
when 'cng'
Trigger::CNG.new.invoke!.wait!
when 'gitlab-com-database-testing'