2022-08-27 11:52:29 +05:30
.row.gl-mt-3.gl-mb-3
2018-03-17 18:26:18 +05:30
.col-lg-12
2022-11-25 23:54:43 +05:30
= render Pajamas::CardComponent.new do |c|
2023-07-09 08:55:56 +05:30
- c.with_header do
2021-04-29 21:17:54 +05:30
= _("Manage your project's triggers")
2023-07-09 08:55:56 +05:30
- c.with_body do
2021-04-29 21:17:54 +05:30
= render 'projects/triggers/form', btn_text: _('Add trigger')
2022-11-25 23:54:43 +05:30
.gl-mb-5
2023-03-17 16:20:25 +05:30
#js-ci-pipeline-triggers-list.triggers-list{ data: { triggers: @triggers_json } }
2023-07-09 08:55:56 +05:30
- c.with_footer do
2016-09-29 09:46:39 +05:30
%p
2021-04-29 21:17:54 +05:30
= _("These examples show how to trigger this project's pipeline for a branch or tag.")
2015-09-25 12:07:36 +05:30
2016-09-29 09:46:39 +05:30
%p.light
2021-04-29 21:17:54 +05:30
= _('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-03-11 19:13:27 +05:30
%h5.gl-mt-3
2021-04-29 21:17:54 +05:30
= _('Use cURL')
2015-09-25 12:07:36 +05:30
2016-09-29 09:46:39 +05:30
%pre
:plain
curl -X POST \
2022-03-02 08:16:31 +05:30
--fail \
2016-09-29 09:46:39 +05:30
-F token=TOKEN \
-F ref=REF_NAME \
#{builds_trigger_url(@project.id)}
2020-07-28 23:09:34 +05:30
%h5.gl-mt-3
2021-04-29 21:17:54 +05:30
= _('Use .gitlab-ci.yml')
2015-09-25 12:07:36 +05:30
2016-09-29 09:46:39 +05:30
%pre
:plain
2021-03-11 19:13:27 +05:30
script:
2022-03-02 08:16:31 +05:30
- "curl -X POST --fail -F token=TOKEN -F ref=REF_NAME #{builds_trigger_url(@project.id)}"
2020-07-28 23:09:34 +05:30
%h5.gl-mt-3
2021-04-29 21:17:54 +05:30
= _('Use webhook')
2017-08-17 22:00:37 +05:30
%pre
:plain
2021-03-11 19:13:27 +05:30
#{builds_trigger_url(@project.id, ref: 'REF_NAME')}?token=TOKEN
2020-07-28 23:09:34 +05:30
%h5.gl-mt-3
2021-04-29 21:17:54 +05:30
= _('Pass job variables')
2016-09-29 09:46:39 +05:30
%p.light
2021-04-29 21:17:54 +05:30
= _('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-29 09:46:39 +05:30
2021-03-11 19:13:27 +05:30
%p.light
2021-04-29 21:17:54 +05:30
= _('cURL:')
2017-08-17 22:00:37 +05:30
%pre
2016-09-29 09:46:39 +05:30
:plain
curl -X POST \
2022-03-02 08:16:31 +05:30
--fail \
2016-09-29 09:46:39 +05:30
-F token=TOKEN \
-F "ref=REF_NAME" \
-F "variables[RUN_NIGHTLY_BUILD]=true" \
#{builds_trigger_url(@project.id)}
2017-08-17 22:00:37 +05:30
%p.light
2021-04-29 21:17:54 +05:30
= _('Webhook:')
2017-08-17 22:00:37 +05:30
2020-06-23 00:09:42 +05:30
%pre.gl-mb-0
2017-08-17 22:00:37 +05:30
:plain
2021-03-11 19:13:27 +05:30
#{builds_trigger_url(@project.id, ref: 'REF_NAME')}?token=TOKEN&variables[RUN_NIGHTLY_BUILD]=true