Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-docs.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAchilleas Pipinellis <axil@gitlab.com>2018-06-20 21:14:23 +0300
committerAchilleas Pipinellis <axil@gitlab.com>2018-06-21 09:19:58 +0300
commit3e9b9bc6710f3a037fec03637f8d785b29ee7d0b (patch)
tree2b9852090db5e52433ed648fdf2e976dc30c56c6 /Rakefile
parent1ec45659f4c8fafa319628ec7115c26165cec4ca (diff)
Limit the pipeline to pull only the repo where the MR is
Diffstat (limited to 'Rakefile')
-rw-r--r--Rakefile16
1 files changed, 15 insertions, 1 deletions
diff --git a/Rakefile b/Rakefile
index c1f0c33e..2d93a50a 100644
--- a/Rakefile
+++ b/Rakefile
@@ -12,6 +12,13 @@ end
desc 'Setup repositories for CE, EE, Omnibus and Runner in special way exposing only their doc directories'
task :setup_repos do
products.each_value do |product|
+ branch = retrieve_branch(product['slug'])
+
+ # Limit the pipeline to pull only the repo where the MR is, not all 4, to save time/space.
+ # First we check if the branch on the docs repo is other than 'master' and
+ # then we skip if the remote branch variable is 'master'.
+ next if ENV["CI_COMMIT_REF_NAME"] != 'master' and branch == 'master'
+
next if File.exist?(product['dirs']['temp_dir'])
puts "\n=> Setting up repository #{product['repo']} into #{product['dirs']['temp_dir']}\n"
@@ -30,6 +37,8 @@ end
desc 'Setup content directories by symlinking to the repositories documentation folder'
task :setup_content_dirs do
products.each_value do |product|
+ next unless File.exist?(product['dirs']['temp_dir'])
+
source = File.join('../', product['dirs']['temp_dir'], product['dirs']['doc_dir'])
target = product['dirs']['dest_dir']
@@ -46,6 +55,11 @@ task :pull_repos do
products.each_value do |product|
branch = retrieve_branch(product['slug'])
+ # Limit the pipeline to pull only the repo where the MR is, not all 4, to save time/space.
+ # First we check if the branch on the docs repo is other than 'master' and
+ # then we skip if the remote branch variable is 'master'.
+ next if ENV["CI_COMMIT_REF_NAME"] != 'master' and branch == 'master'
+
puts "\n=> Pulling #{branch} of #{product['repo']}\n"
# Enter the temporary directory and return after block is completed.
@@ -88,4 +102,4 @@ namespace :release do
post.puts content
end
end
-end \ No newline at end of file
+end