diff options
author | Mayra Cabrera <mcabrera@gitlab.com> | 2018-08-10 16:45:14 +0300 |
---|---|---|
committer | Kamil TrzciĆski <ayufan@ayufan.eu> | 2018-08-10 16:45:14 +0300 |
commit | 33311cb677592e58c05e4da3cd511bef246fc9d7 (patch) | |
tree | 515e09c97655aa76c0a12259c3f4e0227a716084 /app/services/ci | |
parent | 91795dcd1c0d12d2350e0d00489d89be9fa29b32 (diff) |
CE Port of Protected Environments backend
Diffstat (limited to 'app/services/ci')
-rw-r--r-- | app/services/ci/enqueue_build_service.rb | 8 | ||||
-rw-r--r-- | app/services/ci/process_pipeline_service.rb | 6 |
2 files changed, 13 insertions, 1 deletions
diff --git a/app/services/ci/enqueue_build_service.rb b/app/services/ci/enqueue_build_service.rb new file mode 100644 index 00000000000..8140651d980 --- /dev/null +++ b/app/services/ci/enqueue_build_service.rb @@ -0,0 +1,8 @@ +# frozen_string_literal: true +module Ci + class EnqueueBuildService < BaseService + def execute(build) + build.enqueue + end + end +end diff --git a/app/services/ci/process_pipeline_service.rb b/app/services/ci/process_pipeline_service.rb index cda9bbff3b4..cafee76a33c 100644 --- a/app/services/ci/process_pipeline_service.rb +++ b/app/services/ci/process_pipeline_service.rb @@ -37,7 +37,7 @@ module Ci def process_build(build, current_status) if valid_statuses_for_when(build.when).include?(current_status) - build.action? ? build.actionize : build.enqueue + build.action? ? build.actionize : enqueue_build(build) true else build.skip @@ -93,5 +93,9 @@ module Ci .where.not(id: latest_statuses.map(&:first)) .update_all(retried: true) if latest_statuses.any? end + + def enqueue_build(build) + Ci::EnqueueBuildService.new(project, @user).execute(build) + end end end |