2020-06-26 02:09:03 -04:00
.row.gl-mt-3.gl-mb-3.triggers-container
2017-09-06 11:38:13 -04:00
.col-lg-12
2018-04-10 13:11:34 -04:00
.card
.card-header
2021-04-09 11:09:10 -04:00
= _("Manage your project's triggers")
2018-04-10 13:11:34 -04:00
.card-body
2021-04-09 11:09:10 -04:00
= render 'projects/triggers/form', btn_text: _('Add trigger')
2017-03-07 08:02:56 -05:00
%hr
2020-09-28 14:09:40 -04:00
- if Feature.enabled?(:ci_pipeline_triggers_settings_vue_ui, @project)
#js-ci-pipeline-triggers-list.triggers-list{ data: { triggers: @triggers_json } }
2016-09-06 04:36:04 -04:00
- else
2020-09-28 14:09:40 -04:00
- if @triggers.any?
.table-responsive.triggers-list
%table.table
%thead
%th
2021-01-28 16:09:04 -05:00
%strong
2021-04-09 11:09:10 -04:00
= _('Token')
2020-09-28 14:09:40 -04:00
%th
2021-01-28 16:09:04 -05:00
%strong
2021-04-09 11:09:10 -04:00
= _('Description')
2020-09-28 14:09:40 -04:00
%th
2021-01-28 16:09:04 -05:00
%strong
2021-04-09 11:09:10 -04:00
= _('Owner')
2020-09-28 14:09:40 -04:00
%th
2021-01-28 16:09:04 -05:00
%strong
2021-04-09 11:09:10 -04:00
= _('Last used')
2020-09-28 14:09:40 -04:00
%th
= render partial: 'projects/triggers/trigger', collection: @triggers, as: :trigger
- else
%p.settings-message.text-center.gl-mb-3{ data: { testid: 'no_triggers_content' } }
2021-04-09 11:09:10 -04:00
= _('No triggers exist yet. Use the form above to create one.')
2015-08-25 21:42:46 -04:00
2018-04-10 13:11:34 -04:00
.card-footer
2015-08-25 21:42:46 -04:00
2016-09-06 04:36:04 -04:00
%p
2021-04-09 11:09:10 -04:00
= _("These examples show how to trigger this project's pipeline for a branch or tag.")
2015-08-25 21:42:46 -04:00
2016-09-06 04:36:04 -04:00
%p.light
2021-04-09 11:09:10 -04:00
= _('In each example, replace %{code_start}TOKEN%{code_end} with the trigger token you generated and replace %{code_start}REF_NAME%{code_end} with the branch or tag name.').html_safe % { code_start: '<code>'.html_safe, code_end: '</code>'.html_safe }
2021-01-28 16:09:04 -05:00
%h5.gl-mt-3
2021-04-09 11:09:10 -04:00
= _('Use cURL')
2015-08-25 21:42:46 -04:00
2016-09-06 04:36:04 -04:00
%pre
:plain
curl -X POST \
2021-12-23 01:10:27 -05:00
--fail \
2016-09-06 04:36:04 -04:00
-F token=TOKEN \
-F ref=REF_NAME \
#{builds_trigger_url(@project.id)}
2020-06-26 02:09:03 -04:00
%h5.gl-mt-3
2021-04-09 11:09:10 -04:00
= _('Use .gitlab-ci.yml')
2015-08-25 21:42:46 -04:00
2016-09-06 04:36:04 -04:00
%pre
:plain
2021-01-28 16:09:04 -05:00
script:
2021-12-23 01:10:27 -05:00
- "curl -X POST --fail -F token=TOKEN -F ref=REF_NAME #{builds_trigger_url(@project.id)}"
2020-06-26 02:09:03 -04:00
%h5.gl-mt-3
2021-04-09 11:09:10 -04:00
= _('Use webhook')
2016-11-07 12:11:54 -05:00
%pre
:plain
2021-01-28 16:09:04 -05:00
#{builds_trigger_url(@project.id, ref: 'REF_NAME')}?token=TOKEN
2020-06-26 02:09:03 -04:00
%h5.gl-mt-3
2021-04-09 11:09:10 -04:00
= _('Pass job variables')
2016-09-06 04:36:04 -04:00
%p.light
2021-04-09 11:09:10 -04:00
= _('To pass variables to the triggered pipeline, add %{code_start}variables[VARIABLE]=VALUE%{code_end} to the API request.').html_safe % { code_start: '<code>'.html_safe, code_end: '</code>'.html_safe }
2016-09-06 04:36:04 -04:00
2021-01-28 16:09:04 -05:00
%p.light
2021-04-09 11:09:10 -04:00
= _('cURL:')
2016-11-07 12:11:54 -05:00
%pre
2016-09-06 04:36:04 -04:00
:plain
curl -X POST \
2021-12-23 01:10:27 -05:00
--fail \
2016-09-06 04:36:04 -04:00
-F token=TOKEN \
-F "ref=REF_NAME" \
-F "variables[RUN_NIGHTLY_BUILD]=true" \
#{builds_trigger_url(@project.id)}
2016-11-07 12:11:54 -05:00
%p.light
2021-04-09 11:09:10 -04:00
= _('Webhook:')
2016-11-07 12:11:54 -05:00
2020-05-25 02:08:38 -04:00
%pre.gl-mb-0
2016-11-07 12:11:54 -05:00
:plain
2021-01-28 16:09:04 -05:00
#{builds_trigger_url(@project.id, ref: 'REF_NAME')}?token=TOKEN&variables[RUN_NIGHTLY_BUILD]=true