diff options
author | Kamil Trzciński <ayufan@ayufan.eu> | 2019-04-12 12:53:50 +0200 |
---|---|---|
committer | Kamil Trzciński <ayufan@ayufan.eu> | 2019-04-12 12:53:50 +0200 |
commit | cd51399a30d8759bf9e657123a27de431298f045 (patch) | |
tree | a13d8190a8a509e317d3175abdf6bc60e6e1fafb | |
parent | f3d1e5533a1f1bcfe43a0d8d0a6c13bdff789417 (diff) | |
download | gitlab-ce-cd51399a30d8759bf9e657123a27de431298f045.tar.gz |
Backport limit-amount-of-created-pipelines to 11.1011-10-stable-prepare-rc7-pick-27205
-rw-r--r-- | app/services/git/branch_push_service.rb | 6 | ||||
-rw-r--r-- | app/services/git/tag_push_service.rb | 6 | ||||
-rw-r--r-- | spec/workers/post_receive_spec.rb | 1 |
3 files changed, 11 insertions, 2 deletions
diff --git a/app/services/git/branch_push_service.rb b/app/services/git/branch_push_service.rb index b55aeb5f2b9..a5113300f5d 100644 --- a/app/services/git/branch_push_service.rb +++ b/app/services/git/branch_push_service.rb @@ -142,7 +142,11 @@ module Git .perform_async(project.id, current_user.id, params[:oldrev], params[:newrev], params[:ref]) EventCreateService.new.push(project, current_user, build_push_data) - Ci::CreatePipelineService.new(project, current_user, build_push_data).execute(:push, pipeline_options) + + if params.fetch(:create_pipelines, true) + Ci::CreatePipelineService.new(project, current_user, build_push_data) + .execute(:push, pipeline_options) + end project.execute_hooks(build_push_data.dup, :push_hooks) project.execute_services(build_push_data.dup, :push_hooks) diff --git a/app/services/git/tag_push_service.rb b/app/services/git/tag_push_service.rb index 9ce0fbdb206..ddf1a2d04fc 100644 --- a/app/services/git/tag_push_service.rb +++ b/app/services/git/tag_push_service.rb @@ -11,7 +11,11 @@ module Git @push_data = build_push_data EventCreateService.new.push(project, current_user, push_data) - Ci::CreatePipelineService.new(project, current_user, push_data).execute(:push, pipeline_options) + + if params.fetch(:create_pipelines, true) + Ci::CreatePipelineService.new(project, current_user, push_data) + .execute(:push, pipeline_options) + end project.execute_hooks(push_data.dup, :tag_push_hooks) project.execute_services(push_data.dup, :tag_push_hooks) diff --git a/spec/workers/post_receive_spec.rb b/spec/workers/post_receive_spec.rb index d269bc95201..7c39877be06 100644 --- a/spec/workers/post_receive_spec.rb +++ b/spec/workers/post_receive_spec.rb @@ -97,6 +97,7 @@ describe PostReceive do 123456 789012 refs/heads/feature2 123458 789013 refs/heads/feature3 123459 789015 refs/heads/feature4 + 654321 210987 refs/tags/tag2 EOF end |