Commit 4d555032 authored by Rémy Coutable's avatar Rémy Coutable

Merge branch 'simplify-docs-review-script' into 'master'

Change logic of repo name and slugs in docs review script

See merge request gitlab-org/gitlab-ce!15395
parents 6ca24bd2 e1fb8b35
......@@ -30,13 +30,6 @@ def docs_branch
"preview-#{ENV["CI_COMMIT_REF_SLUG"]}"[0...max]
end
#
# Dummy way to find out in which repo we are, CE or EE
#
def ee?
File.exist?('CHANGELOG-EE.md')
end
#
# Create a remote branch in gitlab-docs
#
......@@ -55,15 +48,35 @@ def remove_remote_branch
puts "Remote branch '#{docs_branch}' deleted"
end
#
# Define suffix in review app URL based on project
#
def slug
case ENV["CI_PROJECT_NAME"]
when 'gitlab-ce'
'ce'
when 'gitlab-ee'
'ee'
when 'gitlab-runner'
'runner'
when 'omnibus-gitlab'
'omnibus'
end
end
#
# Overriding vars in https://gitlab.com/gitlab-com/gitlab-docs/blob/master/.gitlab-ci.yml
#
def param_name
"BRANCH_#{slug.upcase}"
end
#
# Trigger a pipeline in gitlab-docs
#
def trigger_pipeline
# Overriding vars in https://gitlab.com/gitlab-com/gitlab-docs/blob/master/.gitlab-ci.yml
param_name = ee? ? 'BRANCH_EE' : 'BRANCH_CE'
# The review app URL
app_url = "http://#{docs_branch}.#{ENV["DOCS_REVIEW_APPS_DOMAIN"]}/#{ee? ? 'ee' : 'ce'}"
app_url = "http://#{docs_branch}.#{ENV["DOCS_REVIEW_APPS_DOMAIN"]}/#{slug}"
# Create the 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