2015-11-03 05:44:07 -05:00
|
|
|
- page_title "Triggers"
|
2015-08-25 21:42:46 -04:00
|
|
|
|
2016-04-27 09:04:59 -04:00
|
|
|
.row.prepend-top-default.append-bottom-default
|
|
|
|
.col-lg-3
|
|
|
|
%h4.prepend-top-0
|
|
|
|
= page_title
|
|
|
|
%p
|
2016-05-24 11:04:43 -04:00
|
|
|
Triggers can force a specific branch or tag to rebuild with an API call.
|
2016-04-27 09:04:59 -04:00
|
|
|
.col-lg-9
|
|
|
|
%h5.prepend-top-0
|
|
|
|
Your triggers
|
|
|
|
- if @triggers.any?
|
|
|
|
.table-responsive
|
|
|
|
%table.table
|
|
|
|
%thead
|
|
|
|
%th Token
|
|
|
|
%th Last used
|
|
|
|
%th
|
|
|
|
= render partial: 'trigger', collection: @triggers, as: :trigger
|
|
|
|
- else
|
2016-05-16 10:40:44 -04:00
|
|
|
%p.settings-message.text-center.append-bottom-default
|
2016-05-24 11:04:43 -04:00
|
|
|
No triggers have been created yet. Add one using the button below.
|
2015-08-25 21:42:46 -04:00
|
|
|
|
2016-04-27 09:04:59 -04:00
|
|
|
= form_for @trigger, url: url_for(controller: 'projects/triggers', action: 'create') do |f|
|
|
|
|
= f.submit "Add Trigger", class: 'btn btn-success'
|
2015-08-25 21:42:46 -04:00
|
|
|
|
2016-04-27 09:04:59 -04:00
|
|
|
%h5.prepend-top-default
|
|
|
|
Use CURL
|
2015-08-25 21:42:46 -04:00
|
|
|
|
2016-04-27 09:04:59 -04:00
|
|
|
%p.light
|
2016-05-24 11:04:43 -04:00
|
|
|
Copy the token above, set your branch or tag name, and that reference will be rebuilt.
|
2015-08-25 21:42:46 -04:00
|
|
|
|
2016-04-27 09:04:59 -04:00
|
|
|
%pre
|
|
|
|
:plain
|
|
|
|
curl -X POST \
|
|
|
|
-F token=TOKEN \
|
|
|
|
-F ref=REF_NAME \
|
|
|
|
#{builds_trigger_url(@project.id)}
|
|
|
|
%h5.prepend-top-default
|
|
|
|
Use .gitlab-ci.yml
|
2015-08-25 21:42:46 -04:00
|
|
|
|
2016-04-27 09:04:59 -04:00
|
|
|
%p.light
|
2016-05-22 12:41:30 -04:00
|
|
|
In the
|
|
|
|
%code .gitlab-ci.yml
|
|
|
|
of the dependent project, include the following snippet.
|
|
|
|
The project will rebuild at the end of the build.
|
2015-08-25 21:42:46 -04:00
|
|
|
|
2016-04-27 09:04:59 -04:00
|
|
|
%pre
|
|
|
|
:plain
|
|
|
|
trigger:
|
|
|
|
type: deploy
|
|
|
|
script:
|
|
|
|
- "curl -X POST -F token=TOKEN -F ref=REF_NAME #{builds_trigger_url(@project.id)}"
|
|
|
|
%h5.prepend-top-default
|
|
|
|
Pass build variables
|
2015-08-25 21:42:46 -04:00
|
|
|
|
2016-04-27 09:04:59 -04:00
|
|
|
%p.light
|
|
|
|
Add
|
2016-05-22 12:41:30 -04:00
|
|
|
%code variables[VARIABLE]=VALUE
|
2016-05-24 11:04:43 -04:00
|
|
|
to an API request. Variable values can be used to distinguish between triggered builds and normal builds.
|
2015-08-25 21:42:46 -04:00
|
|
|
|
2016-04-27 09:04:59 -04:00
|
|
|
%pre.append-bottom-0
|
|
|
|
:plain
|
|
|
|
curl -X POST \
|
|
|
|
-F token=TOKEN \
|
|
|
|
-F "ref=REF_NAME" \
|
|
|
|
-F "variables[RUN_NIGHTLY_BUILD]=true" \
|
|
|
|
#{builds_trigger_url(@project.id)}
|