diff options
author | Achilleas Pipinellis <axil@gitlab.com> | 2018-06-29 18:34:31 +0300 |
---|---|---|
committer | Achilleas Pipinellis <axil@gitlab.com> | 2018-06-30 12:58:31 +0300 |
commit | 506a6123df32f449d5a3a9222114a87e9fc4ae66 (patch) | |
tree | 798c9dcdaa0015340c5c47d754b09dfc785f6a81 /Rakefile | |
parent | 08aa59481edb8b49d35218032565f38b14127611 (diff) |
Check the branch name before pulling from upstream branches
Fixes https://gitlab.com/gitlab-com/gitlab-docs/issues/224
Diffstat (limited to 'Rakefile')
-rw-r--r-- | Rakefile | 14 |
1 files changed, 10 insertions, 4 deletions
@@ -17,8 +17,11 @@ task :setup_repos do # 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' + # then we skip if the remote branch variable is 'master'. Finally, + # check if the pipeline was triggered via the API (multi-project pipeline) + # to exclude the case where we create a branch right off the gitlab-docs + # project. + next if ENV["CI_COMMIT_REF_NAME"] != 'master' and branch == 'master' and ENV["CI_PIPELINE_SOURCE"] == 'pipeline' next if File.exist?(product['dirs']['temp_dir']) @@ -58,8 +61,11 @@ task :pull_repos do # 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' + # then we skip if the remote branch variable is 'master'. Finally, + # check if the pipeline was triggered via the API (multi-project pipeline) + # to exclude the case where we create a branch right off the gitlab-docs + # project. + next if ENV["CI_COMMIT_REF_NAME"] != 'master' and branch == 'master' and ENV["CI_PIPELINE_SOURCE"] == 'pipeline' puts "\n=> Pulling #{branch} of #{product['repo']}\n" |