diff options
author | Dmitry Poray <dmip@interprogma.ru> | 2016-11-07 20:11:54 +0300 |
---|---|---|
committer | Dmitry Poray <dmip@interprogma.ru> | 2016-11-15 17:19:33 +0300 |
commit | ff8194e0ec16092419862011d7cc048baa149c42 (patch) | |
tree | eaaf61f02c9c2d59719a3a941463a9ed2a0565f3 /app/helpers/triggers_helper.rb | |
parent | c5e147de1288130147ec0f500bea50353d441cb8 (diff) | |
download | gitlab-ce-ff8194e0ec16092419862011d7cc048baa149c42.tar.gz |
Add ref parameter for triggerring builds with gitlab webhook from other project.
Diffstat (limited to 'app/helpers/triggers_helper.rb')
-rw-r--r-- | app/helpers/triggers_helper.rb | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/app/helpers/triggers_helper.rb b/app/helpers/triggers_helper.rb index 8cad994d10f..c41181bab3d 100644 --- a/app/helpers/triggers_helper.rb +++ b/app/helpers/triggers_helper.rb @@ -1,5 +1,9 @@ module TriggersHelper - def builds_trigger_url(project_id) - "#{Settings.gitlab.url}/api/v3/projects/#{project_id}/trigger/builds" + def builds_trigger_url(project_id, ref: nil) + if ref.nil? + "#{Settings.gitlab.url}/api/v3/projects/#{project_id}/trigger/builds" + else + "#{Settings.gitlab.url}/api/v3/projects/#{project_id}/ref/#{ref}/trigger/builds" + end end end |