summaryrefslogtreecommitdiff
path: root/app/views/projects/triggers/index.html.haml
blob: f91885b216dee72beeb97d2adda59cf50b30e551 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
- page_title "Triggers"

.row.prepend-top-default.append-bottom-default
  .col-lg-3
    %h4.prepend-top-0
      = page_title
    %p
      Triggers can be used to force a rebuild of a specific branch or tag with an API call.
  .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
      %p.profile-settings-message.text-center.append-bottom-default
        There are no triggers to use, add one by the button below.

    = form_for @trigger, url: url_for(controller: 'projects/triggers', action: 'create') do |f|
      = f.submit "Add Trigger", class: 'btn btn-success'

    %h5.prepend-top-default
      Use CURL

    %p.light
      Copy the token above and set your branch or tag name. This is the reference that will be rebuild.


    %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

    %p.light
      Copy the snippet to
      %i .gitlab-ci.yml
      of dependent project.
      At the end of your build it will trigger this project to rebuilt.

    %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

    %p.light
      Add
      %strong variables[VARIABLE]=VALUE
      to API request.
      The value of variable could then be used to distinguish triggered build from normal one.

    %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)}