summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRémy Coutable <remy@rymai.me>2017-11-16 12:18:25 +0000
committerRémy Coutable <remy@rymai.me>2017-11-16 12:18:25 +0000
commit4d55503217316ea9a8a4f1a5523814b5eb20ed49 (patch)
treec77360ac2ff97a3ae272674967bd4fce70640b76
parent6ca24bd2e196ba3509d52b167bf7592c0afa2793 (diff)
parente1fb8b35e7a298233fc635c5ec4be30debc1045c (diff)
downloadgitlab-ce-4d55503217316ea9a8a4f1a5523814b5eb20ed49.tar.gz
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
-rwxr-xr-xscripts/trigger-build-docs35
1 files changed, 24 insertions, 11 deletions
diff --git a/scripts/trigger-build-docs b/scripts/trigger-build-docs
index d3a9f5ff4ea..89ad6a99467 100755
--- a/scripts/trigger-build-docs
+++ b/scripts/trigger-build-docs
@@ -31,13 +31,6 @@ def docs_branch
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
#
def create_remote_branch
@@ -56,14 +49,34 @@ def remove_remote_branch
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..."