From ecdab9f96f5ab94292b52010618847e88e8573fd Mon Sep 17 00:00:00 2001 From: Achilleas Pipinellis Date: Thu, 7 Sep 2017 15:43:20 +0000 Subject: Add script and job to trigger a docs build --- scripts/trigger-build-omnibus | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100755 scripts/trigger-build-omnibus (limited to 'scripts/trigger-build-omnibus') diff --git a/scripts/trigger-build-omnibus b/scripts/trigger-build-omnibus new file mode 100755 index 00000000000..dcda70d7ed8 --- /dev/null +++ b/scripts/trigger-build-omnibus @@ -0,0 +1,27 @@ +#!/usr/bin/env ruby + +require 'net/http' +require 'json' + +uri = URI('https://gitlab.com/api/v4/projects/20699/trigger/pipeline') +params = { + "ref" => ENV["OMNIBUS_BRANCH"] || "master", + "token" => ENV["BUILD_TRIGGER_TOKEN"], + "variables[GITLAB_VERSION]" => ENV["CI_COMMIT_SHA"], + "variables[ALTERNATIVE_SOURCES]" => true, + "variables[ee]" => ENV["EE_PACKAGE"] || "false" +} + +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'] + +unless pipeline_id.nil? + puts "Triggered pipeline can be found at https://gitlab.com/gitlab-org/omnibus-gitlab/pipelines/#{pipeline_id}" +else + puts "Trigger failed. The response from trigger is: " + puts res.body +end -- cgit v1.2.1