2015-09-29 10:26:40 -04:00
|
|
|
module TriggersHelper
|
2016-11-07 12:11:54 -05:00
|
|
|
def builds_trigger_url(project_id, ref: nil)
|
|
|
|
if ref.nil?
|
2017-03-05 14:58:08 -05:00
|
|
|
"#{Settings.gitlab.url}/api/v4/projects/#{project_id}/trigger/pipeline"
|
2016-11-07 12:11:54 -05:00
|
|
|
else
|
2017-03-05 14:58:08 -05:00
|
|
|
"#{Settings.gitlab.url}/api/v4/projects/#{project_id}/ref/#{ref}/trigger/pipeline"
|
2016-11-07 12:11:54 -05:00
|
|
|
end
|
2015-09-29 10:26:40 -04:00
|
|
|
end
|
2016-11-14 09:10:35 -05:00
|
|
|
|
|
|
|
def service_trigger_url(service)
|
|
|
|
"#{Settings.gitlab.url}/api/v3/projects/#{service.project_id}/services/#{service.to_param}/trigger"
|
|
|
|
end
|
2015-09-29 10:26:40 -04:00
|
|
|
end
|