diff options
author | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2018-01-24 16:26:03 +0300 |
---|---|---|
committer | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2018-01-24 16:26:03 +0300 |
commit | aa290573aece6408ad8bb98c7a04257202be5ff8 (patch) | |
tree | b37c17415ce71178ba4907878a1e024f56c9dba0 /app/services/ci | |
parent | e73333242ac42a1020319f5d491daf0647af4c54 (diff) |
Add a new service for creating detached CI/CD jobs
Diffstat (limited to 'app/services/ci')
-rw-r--r-- | app/services/ci/create_job_service.rb | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/app/services/ci/create_job_service.rb b/app/services/ci/create_job_service.rb new file mode 100644 index 00000000000..683c3557cd0 --- /dev/null +++ b/app/services/ci/create_job_service.rb @@ -0,0 +1,12 @@ +module Ci + class CreateJobService < BaseService + def execute(subject = nil) + (subject || yield).tap do |subject| + Ci::EnsureStageService.new(project, current_user) + .execute(subject) + + subject.save! + end + end + end +end |