Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorKamil Trzcinski <ayufan@ayufan.eu>2015-12-10 20:04:40 +0300
committerKamil Trzcinski <ayufan@ayufan.eu>2015-12-11 20:02:09 +0300
commit3d9ce37a48615032c786913acdde1eedba351361 (patch)
tree97999e407b8823327b4558060b370af829fdbd1f /app
parent64bfd9d71a4017e0b5336a2c1565926f4b8beedd (diff)
Reimplement Trigger API
Diffstat (limited to 'app')
-rw-r--r--app/helpers/triggers_helper.rb4
-rw-r--r--app/views/projects/triggers/index.html.haml8
2 files changed, 7 insertions, 5 deletions
diff --git a/app/helpers/triggers_helper.rb b/app/helpers/triggers_helper.rb
index 2a3a7e80fca..8cad994d10f 100644
--- a/app/helpers/triggers_helper.rb
+++ b/app/helpers/triggers_helper.rb
@@ -1,5 +1,5 @@
module TriggersHelper
- def ci_build_trigger_url(project_id, ref_name)
- "#{Settings.gitlab_ci.url}/ci/api/v1/projects/#{project_id}/refs/#{ref_name}/trigger"
+ def builds_trigger_url(project_id)
+ "#{Settings.gitlab.url}/api/v3/projects/#{project_id}/trigger/builds"
end
end
diff --git a/app/views/projects/triggers/index.html.haml b/app/views/projects/triggers/index.html.haml
index 147cda51d5a..fb3794764c5 100644
--- a/app/views/projects/triggers/index.html.haml
+++ b/app/views/projects/triggers/index.html.haml
@@ -36,7 +36,8 @@
:plain
curl -X POST \
-F token=TOKEN \
- #{ci_build_trigger_url(@project.id, 'REF_NAME')}
+ -F ref=REF_NAME \
+ #{builds_trigger_url(@project.id)}
%h3
Use .gitlab-ci.yml
@@ -51,7 +52,7 @@
trigger:
type: deploy
script:
- - "curl -X POST -F token=TOKEN #{ci_build_trigger_url(@project.id, 'REF_NAME')}"
+ - "curl -X POST -F token=TOKEN -F ref=REF_NAME #{builds_trigger_url(@project.id)}"
%h3
Pass build variables
@@ -65,5 +66,6 @@
:plain
curl -X POST \
-F token=TOKEN \
+ -F "ref=REF_NAME" \
-F "variables[RUN_NIGHTLY_BUILD]=true" \
- #{ci_build_trigger_url(@project.id, 'REF_NAME')}
+ #{builds_trigger_url(@project.id, 'TOKEN')}