From 3e9b9bc6710f3a037fec03637f8d785b29ee7d0b Mon Sep 17 00:00:00 2001 From: Achilleas Pipinellis Date: Wed, 20 Jun 2018 20:14:23 +0200 Subject: Limit the pipeline to pull only the repo where the MR is --- Rakefile | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'Rakefile') 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 -- cgit v1.2.3