gitlab-org--gitlab-foss/app/services/ci/create_trigger_request_service.rb

14 lines
406 B
Ruby
Raw Normal View History

2015-08-25 21:42:46 -04:00
module Ci
class CreateTriggerRequestService
def execute(project, trigger, ref, variables = nil)
trigger_request = trigger.trigger_requests.create(variables: variables)
2015-08-25 21:42:46 -04:00
pipeline = Ci::CreatePipelineService.new(project, nil, ref: ref).
execute(ignore_skip_ci: true, trigger_request: trigger_request)
if pipeline.persisted?
2015-08-25 21:42:46 -04:00
trigger_request
end
end
end
end