BigW Consortium Gitlab

triggers_helper.rb 425 Bytes
Newer Older
1
module TriggersHelper
2 3
  def builds_trigger_url(project_id, ref: nil)
    if ref.nil?
4
      "#{Settings.gitlab.url}/api/v4/projects/#{project_id}/trigger/pipeline"
5
    else
6
      "#{Settings.gitlab.url}/api/v4/projects/#{project_id}/ref/#{ref}/trigger/pipeline"
7
    end
8
  end
9 10 11 12

  def service_trigger_url(service)
    "#{Settings.gitlab.url}/api/v3/projects/#{service.project_id}/services/#{service.to_param}/trigger"
  end
13
end