Commit a501feb4 authored by Robert Speicher's avatar Robert Speicher

Resolve RuboCop violations in scripts/trigger-build-docs

parent 45510326
...@@ -7,7 +7,7 @@ require 'gitlab' ...@@ -7,7 +7,7 @@ require 'gitlab'
# in order to avoid conflicts # in order to avoid conflicts
# #
@docs_branch = "#{ENV["CI_COMMIT_REF_SLUG"]}-built-from-ce-ee" @docs_branch = "#{ENV["CI_COMMIT_REF_SLUG"]}-built-from-ce-ee"
GITLAB_DOCS_REPO = 'gitlab-com/gitlab-docs' GITLAB_DOCS_REPO = 'gitlab-com/gitlab-docs'.freeze
# #
# Configure credentials to be used with gitlab gem # Configure credentials to be used with gitlab gem
...@@ -20,8 +20,8 @@ end ...@@ -20,8 +20,8 @@ end
# #
# Dummy way to find out in which repo we are, CE or EE # Dummy way to find out in which repo we are, CE or EE
# #
def is_ee? def ee?
File.exists?('CHANGELOG-EE.md') File.exist?('CHANGELOG-EE.md')
end end
# #
...@@ -30,7 +30,7 @@ end ...@@ -30,7 +30,7 @@ end
def create_remote_branch 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" puts "Remote branch '#{@docs_branch}' created"
rescue Gitlab::Error::BadRequest => e rescue Gitlab::Error::BadRequest
puts "Remote branch '#{@docs_branch}' already exists" puts "Remote branch '#{@docs_branch}' already exists"
end end
...@@ -47,10 +47,10 @@ end ...@@ -47,10 +47,10 @@ end
# #
def trigger_pipeline def trigger_pipeline
# Overriding vars in https://gitlab.com/gitlab-com/gitlab-docs/blob/master/.gitlab-ci.yml # Overriding vars in https://gitlab.com/gitlab-com/gitlab-docs/blob/master/.gitlab-ci.yml
param_name = is_ee? ? 'BRANCH_EE' : 'BRANCH_CE' param_name = ee? ? 'BRANCH_EE' : 'BRANCH_CE'
# The review app URL # The review app URL
app_url = "http://#{@docs_branch}.#{ENV["DOCS_REVIEW_APPS_DOMAIN"]}/#{is_ee? ? 'ee' : 'ce'}" app_url = "http://#{@docs_branch}.#{ENV["DOCS_REVIEW_APPS_DOMAIN"]}/#{ee? ? 'ee' : 'ce'}"
# Create the pipeline # Create the pipeline
puts "=> Triggering a pipeline..." puts "=> Triggering a pipeline..."
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment