Commit 20cbdf80 authored by Achilleas Pipinellis's avatar Achilleas Pipinellis

Clean up and refactor the triggers views

parent b24555b8
...@@ -4,17 +4,26 @@ ...@@ -4,17 +4,26 @@
.col-lg-3 .col-lg-3
%h4.prepend-top-0 %h4.prepend-top-0
= page_title = page_title
%p %p.prepend-top-20
Triggers can force a specific branch or tag to rebuild with an API call. Triggers can force a specific branch or tag to get rebuilt with an API call.
%p.append-bottom-0
= succeed '.' do
Learn more in the
= link_to 'triggers documentation', help_page_path('ci/triggers/README'), target: '_blank'
.col-lg-9 .col-lg-9
%h5.prepend-top-0 .panel.panel-default
Your triggers .panel-heading
%h4.panel-title
Manage your project's triggers
.panel-body
- if @triggers.any? - if @triggers.any?
.table-responsive .table-responsive
%table.table %table.table
%thead %thead
%th Token %th
%th Last used %strong Token
%th
%strong Last used
%th %th
= render partial: 'trigger', collection: @triggers, as: :trigger = render partial: 'trigger', collection: @triggers, as: :trigger
- else - else
...@@ -22,13 +31,28 @@ ...@@ -22,13 +31,28 @@
No triggers have been created yet. Add one using the button below. No triggers have been created yet. Add one using the button below.
= form_for @trigger, url: url_for(controller: 'projects/triggers', action: 'create') do |f| = form_for @trigger, url: url_for(controller: 'projects/triggers', action: 'create') do |f|
= f.submit "Add Trigger", class: 'btn btn-success' = f.submit "Add trigger", class: 'btn btn-success'
.panel-footer
%p
In the following examples, you can see the exact API call you need to
make in order to rebuild a specific
%code ref
(branch or tag) with a trigger token.
%p
All you need to do is replace the
%code TOKEN
and
%code REF_NAME
with the trigger token and the branch or tag name respectively.
%h5.prepend-top-default %h5.prepend-top-default
Use CURL Use cURL
%p.light %p.light
Copy the token above, set your branch or tag name, and that reference will be rebuilt. Copy one of the tokens above, set your branch or tag name, and that
reference will be rebuilt.
%pre %pre
:plain :plain
...@@ -42,12 +66,12 @@ ...@@ -42,12 +66,12 @@
%p.light %p.light
In the In the
%code .gitlab-ci.yml %code .gitlab-ci.yml
of the dependent project, include the following snippet. of another project, include the following snippet.
The project will rebuild at the end of the build. The project will be rebuilt at the end of the build.
%pre %pre
:plain :plain
trigger: trigger_build:
stage: deploy stage: deploy
script: script:
- "curl -X POST -F token=TOKEN -F ref=REF_NAME #{builds_trigger_url(@project.id)}" - "curl -X POST -F token=TOKEN -F ref=REF_NAME #{builds_trigger_url(@project.id)}"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment