Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Jérome Perrin
gitlab-ce
Commits
20cbdf80
Commit
20cbdf80
authored
Sep 06, 2016
by
Achilleas Pipinellis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Clean up and refactor the triggers views
parent
b24555b8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
77 additions
and
53 deletions
+77
-53
app/views/projects/triggers/index.html.haml
app/views/projects/triggers/index.html.haml
+77
-53
No files found.
app/views/projects/triggers/index.html.haml
View file @
20cbdf80
...
@@ -4,65 +4,89 @@
...
@@ -4,65 +4,89 @@
.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
-
if
@triggers
.
any?
%h4
.panel-title
.table-responsive
Manage your project's triggers
%table
.table
.panel-body
%thead
-
if
@triggers
.
any?
%th
Token
.table-responsive
%th
Last used
%table
.table
%th
%thead
=
render
partial:
'trigger'
,
collection:
@triggers
,
as: :trigger
%th
-
else
%strong
Token
%p
.settings-message.text-center.append-bottom-default
%th
No triggers have been created yet. Add one using the button below.
%strong
Last used
%th
=
render
partial:
'trigger'
,
collection:
@triggers
,
as: :trigger
-
else
%p
.settings-message.text-center.append-bottom-default
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 T
rigger"
,
class:
'btn btn-success'
=
f
.
submit
"Add t
rigger"
,
class:
'btn btn-success'
%h5
.prepend-top-default
.panel-footer
Use CURL
%p
.light
%p
Copy the token above, set your branch or tag name, and that reference will be rebuilt.
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.
%pre
%h5
.prepend-top-default
:plain
Use cURL
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
%p
.light
In the
Copy one of the tokens above, set your branch or tag name, and that
%code
.gitlab-ci.yml
reference will be rebuilt.
of the dependent project, include the following snippet.
The project will rebuild at the end of the build.
%pre
%pre
:plain
:plain
trigger:
curl -X POST \
stage: deploy
-F token=TOKEN \
script:
-F ref=REF_NAME \
- "curl -X POST -F token=TOKEN -F ref=REF_NAME
#{
builds_trigger_url
(
@project
.
id
)
}
"
#{
builds_trigger_url
(
@project
.
id
)
}
%h5
.prepend-top-default
%h5
.prepend-top-default
Pass build variables
Use .gitlab-ci.yml
%p
.light
%p
.light
Add
In the
%code
variables[VARIABLE]=VALUE
%code
.gitlab-ci.yml
to an API request. Variable values can be used to distinguish between triggered builds and normal builds.
of another project, include the following snippet.
The project will be rebuilt at the end of the build.
%pre
.append-bottom-0
%pre
:plain
:plain
curl -X POST \
trigger_build:
-F token=TOKEN \
stage: deploy
-F "ref=REF_NAME" \
script:
-F "variables[RUN_NIGHTLY_BUILD]=true" \
- "curl -X POST -F token=TOKEN -F ref=REF_NAME
#{
builds_trigger_url
(
@project
.
id
)
}
"
#{
builds_trigger_url
(
@project
.
id
)
}
%h5
.prepend-top-default
Pass build variables
%p
.light
Add
%code
variables[VARIABLE]=VALUE
to an API request. Variable values can be used to distinguish between triggered builds and normal builds.
%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
)
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment