Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGrzegorz Bizon <grzesiek.bizon@gmail.com>2018-01-24 16:26:03 +0300
committerGrzegorz Bizon <grzesiek.bizon@gmail.com>2018-01-24 16:26:03 +0300
commitaa290573aece6408ad8bb98c7a04257202be5ff8 (patch)
treeb37c17415ce71178ba4907878a1e024f56c9dba0 /app/services/ci
parente73333242ac42a1020319f5d491daf0647af4c54 (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.rb12
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