diff options
Diffstat (limited to 'scripts/trigger-build-docs')
-rwxr-xr-x | scripts/trigger-build-docs | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/scripts/trigger-build-docs b/scripts/trigger-build-docs index dfc8ee6050a..aa496f552b5 100755 --- a/scripts/trigger-build-docs +++ b/scripts/trigger-build-docs @@ -1,19 +1,19 @@ #!/usr/bin/env ruby -require 'gitlab' +require "gitlab" # # Configure credentials to be used with gitlab gem # Gitlab.configure do |config| - config.endpoint = 'https://gitlab.com/api/v4' + config.endpoint = "https://gitlab.com/api/v4" config.private_token = ENV["DOCS_API_TOKEN"] # GitLab Docs bot access token with Developer access to gitlab-docs end # # The remote docs project # -GITLAB_DOCS_REPO = 'gitlab-com/gitlab-docs'.freeze +GITLAB_DOCS_REPO = "gitlab-com/gitlab-docs".freeze # # Truncate the remote docs branch name otherwise we hit the filesystem @@ -34,7 +34,7 @@ end # https://gitlab.com/gitlab-com/gitlab-docs/issues/154. # def create_remote_branch - Gitlab.create_branch(GITLAB_DOCS_REPO, docs_branch, 'master') + Gitlab.create_branch(GITLAB_DOCS_REPO, docs_branch, "master") puts "=> Remote branch '#{docs_branch}' created" pipelines = nil @@ -43,7 +43,7 @@ def create_remote_branch loop do sleep 1 puts "=> Waiting for pipeline to start..." - pipelines = Gitlab.pipelines(GITLAB_DOCS_REPO, { ref: docs_branch }) + pipelines = Gitlab.pipelines(GITLAB_DOCS_REPO, {ref: docs_branch}) break if pipelines.any? end @@ -69,14 +69,14 @@ end # def slug case ENV["CI_PROJECT_NAME"] - when 'gitlab-ce' - 'ce' - when 'gitlab-ee' - 'ee' - when 'gitlab-runner' - 'runner' - when 'omnibus-gitlab' - 'omnibus' + when "gitlab-ce" + "ce" + when "gitlab-ee" + "ee" + when "gitlab-runner" + "runner" + when "omnibus-gitlab" + "omnibus" end end @@ -95,7 +95,7 @@ def trigger_pipeline app_url = "http://#{docs_branch}.#{ENV["DOCS_REVIEW_APPS_DOMAIN"]}/#{slug}" # Create the cross project pipeline using CI_JOB_TOKEN - pipeline = Gitlab.run_trigger(GITLAB_DOCS_REPO, ENV["CI_JOB_TOKEN"], docs_branch, { param_name => ENV["CI_COMMIT_REF_NAME"] }) + pipeline = Gitlab.run_trigger(GITLAB_DOCS_REPO, ENV["CI_JOB_TOKEN"], docs_branch, {param_name => ENV["CI_COMMIT_REF_NAME"]}) puts "=> Follow the status of the triggered pipeline:" puts "" @@ -118,10 +118,10 @@ end # are no stale remote branches and the Review server doesn't fill. # case ARGV[0] -when 'deploy' +when "deploy" create_remote_branch trigger_pipeline -when 'cleanup' +when "cleanup" remove_remote_branch else puts "Please provide a valid option: |