diff options
author | Grzegorz Bizon <grzegorz@gitlab.com> | 2017-12-15 08:26:51 +0000 |
---|---|---|
committer | Grzegorz Bizon <grzegorz@gitlab.com> | 2017-12-15 08:26:51 +0000 |
commit | c96e2edc105a46c93bcbf6841c8ec52270d6a601 (patch) | |
tree | 568aaa1c728538f81d541c76ba4be970d7f7ae78 | |
parent | ee9ad1b1f60374e1b83ef6af481ae7ebdd0e7b2e (diff) | |
parent | 3bbdb8b230198766f3d3d18fbdec7728d0e2b610 (diff) | |
download | gitlab-ce-c96e2edc105a46c93bcbf6841c8ec52270d6a601.tar.gz |
Merge branch 'trigger-user-pipeline-info' into 'master'
Pass info regarding the user and job that initiated a trigger
See merge request gitlab-org/gitlab-ce!15934
-rwxr-xr-x | scripts/trigger-build-omnibus | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/scripts/trigger-build-omnibus b/scripts/trigger-build-omnibus index 4ff0e8e10b7..85ea4aa74ac 100755 --- a/scripts/trigger-build-omnibus +++ b/scripts/trigger-build-omnibus @@ -21,6 +21,7 @@ module Omnibus if id puts "Triggered https://gitlab.com/#{Omnibus::PROJECT_PATH}/pipelines/#{id}" + puts "Waiting for downstream pipeline status" else raise "Trigger failed! The response from the trigger is: #{res.body}" end @@ -39,7 +40,9 @@ module Omnibus "ref" => ENV["OMNIBUS_BRANCH"] || "master", "variables[GITLAB_VERSION]" => ENV["CI_COMMIT_SHA"], "variables[ALTERNATIVE_SOURCES]" => true, - "variables[ee]" => ee? ? 'true' : 'false' + "variables[ee]" => ee? ? 'true' : 'false', + "variables[TRIGGERED_USER]" => ENV["GITLAB_USER_NAME"], + "variables[TRIGGER_SOURCE]" => "https://gitlab.com/gitlab-org/#{ENV['CI_PROJECT_NAME']}/-/jobs/#{ENV['CI_JOB_ID']}" } end @@ -63,14 +66,14 @@ module Omnibus def wait! loop do - raise 'Pipeline timeout!' if timeout? + raise "Pipeline timed out after waiting for #{duration} minutes!" if timeout? case status when :created, :pending, :running - puts "Waiting another #{INTERVAL} seconds ..." + print "." sleep INTERVAL when :success - puts "Omnibus pipeline succeeded!" + puts "Omnibus pipeline succeeded in #{duration} minutes!" break else raise "Omnibus pipeline did not succeed!" @@ -84,6 +87,10 @@ module Omnibus Time.now.to_i > (@start + MAX_DURATION) end + def duration + (Time.now.to_i - @start) / 60 + end + def status req = Net::HTTP::Get.new(@uri) req['PRIVATE-TOKEN'] = ENV['GITLAB_QA_ACCESS_TOKEN'] |