summaryrefslogtreecommitdiff
path: root/app/helpers/triggers_helper.rb
diff options
context:
space:
mode:
authorDmitry Poray <dmip@interprogma.ru>2016-11-07 20:11:54 +0300
committerDmitry Poray <dmip@interprogma.ru>2016-11-15 17:19:33 +0300
commitff8194e0ec16092419862011d7cc048baa149c42 (patch)
treeeaaf61f02c9c2d59719a3a941463a9ed2a0565f3 /app/helpers/triggers_helper.rb
parentc5e147de1288130147ec0f500bea50353d441cb8 (diff)
downloadgitlab-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.rb8
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