debian-mirror-gitlab/app/services/ci/create_trigger_request_service.rb

14 lines
406 B
Ruby
Raw Normal View History

2015-09-25 12:07:36 +05:30
module Ci
class CreateTriggerRequestService
def execute(project, trigger, ref, variables = nil)
2016-09-13 17:45:13 +05:30
trigger_request = trigger.trigger_requests.create(variables: variables)
2015-09-25 12:07:36 +05:30
2016-09-13 17:45:13 +05:30
pipeline = Ci::CreatePipelineService.new(project, nil, ref: ref).
execute(ignore_skip_ci: true, trigger_request: trigger_request)
if pipeline.persisted?
2015-09-25 12:07:36 +05:30
trigger_request
end
end
end
end