Improve readability of code

This commit is contained in:
Balasankar C 2017-05-09 18:51:32 +05:30
parent e85aa42428
commit 784941eee6
No known key found for this signature in database
GPG Key ID: 96EDAB9B2E6B7171
1 changed files with 6 additions and 3 deletions

View File

@ -5,14 +5,17 @@ require 'json'
uri = URI('https://gitlab.com/api/v4/projects/20699/trigger/pipeline')
params = {
"token" => ENV['BUILD_TRIGGER_TOKEN'],
"variables[GITLAB_VERSION]" => ENV['CI_COMMIT_SHA'],
"ref" => ENV["OMNIBUS_BRANCH"] || "master",
"token" => ENV["BUILD_TRIGGER_TOKEN"],
"variables[GITLAB_VERSION]" => ENV["CI_COMMIT_SHA"],
"variables[ALTERNATIVE_SOURCES]" => true,
}
params['ref'] = ENV['OMNIBUS_BRANCH'] || "master"
Dir.glob("*_VERSION").each do |version_file|
params["variables[#{version_file}]"] = File.read(version_file).strip
end
res = Net::HTTP.post_form(uri, params)
pipeline_id = JSON.parse(res.body)['id']
puts "Triggered pipeline can be found at https://gitlab.com/gitlab-org/omnibus-gitlab/pipelines/#{pipeline_id}"