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
Léo-Paul Géneau
gitlab-ce
Commits
1cf8723d
Commit
1cf8723d
authored
Apr 27, 2016
by
Phil Hughes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Updated triggers UI
Closes #14090
parent
6ff740ff
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
63 additions
and
66 deletions
+63
-66
app/assets/stylesheets/framework/tw_bootstrap_variables.scss
app/assets/stylesheets/framework/tw_bootstrap_variables.scss
+1
-1
app/views/projects/triggers/_trigger.html.haml
app/views/projects/triggers/_trigger.html.haml
+3
-5
app/views/projects/triggers/index.html.haml
app/views/projects/triggers/index.html.haml
+59
-60
No files found.
app/assets/stylesheets/framework/tw_bootstrap_variables.scss
View file @
1cf8723d
...
@@ -153,7 +153,7 @@ $nav-link-padding: 13px $gl-padding;
...
@@ -153,7 +153,7 @@ $nav-link-padding: 13px $gl-padding;
//== Code
//== Code
//
//
//##
//##
$pre-bg
:
#f
8fafc
!
default
;
$pre-bg
:
#f
4f7fd
!
default
;
$pre-color
:
$gl-gray
!
default
;
$pre-color
:
$gl-gray
!
default
;
$pre-border-color
:
#e7e9ed
;
$pre-border-color
:
#e7e9ed
;
...
...
app/views/projects/triggers/_trigger.html.haml
View file @
1cf8723d
%tr
%tr
%td
%td
.clearfix
%span
.monospace
=
trigger
.
token
%span
.monospace
=
trigger
.
token
%td
%td
-
if
trigger
.
last_trigger_request
-
if
trigger
.
last_trigger_request
...
@@ -9,6 +8,5 @@
...
@@ -9,6 +8,5 @@
-
else
-
else
Never
Never
%td
%td
.text-right
.pull-right
=
link_to
'Revoke'
,
namespace_project_trigger_path
(
@project
.
namespace
,
@project
,
trigger
),
data:
{
confirm:
'Are you sure?'
},
method: :delete
,
class:
"btn btn-warning btn-sm"
=
link_to
'Revoke'
,
namespace_project_trigger_path
(
@project
.
namespace
,
@project
,
trigger
),
data:
{
confirm:
'Are you sure?'
},
method: :delete
,
class:
"btn btn-danger btn-sm btn-grouped"
app/views/projects/triggers/index.html.haml
View file @
1cf8723d
-
page_title
"Triggers"
-
page_title
"Triggers"
%h3
.page-title
Triggers
%p
.light
.row.prepend-top-default.append-bottom-default
Triggers can be used to force a rebuild of a specific branch or tag with an API call.
.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.
%hr
.clearfix
=
form_for
@trigger
,
url:
url_for
(
controller:
'projects/triggers'
,
action:
'create'
)
do
|
f
|
=
f
.
submit
"Add Trigger"
,
class:
'btn btn-success'
-
if
@triggers
.
any?
%h5
.prepend-top-default
.table-holder
Use CURL
%table
.table
%thead
%th
Token
%th
Last used
%th
=
render
partial:
'trigger'
,
collection:
@triggers
,
as: :trigger
-
else
%h4
No triggers
=
form_for
@trigger
,
url:
url_for
(
controller:
'projects/triggers'
,
action:
'create'
),
html:
{
class:
'form-horizontal'
}
do
|
f
|
%p
.light
.clearfix
Copy the token above and set your branch or tag name. This is the reference that will be rebuild.
=
f
.
submit
"Add Trigger"
,
class:
'btn btn-success pull-right'
%hr
.clearfix
-
if
@triggers
.
any?
%pre
%h3
: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
Copy the token above and set your branch or tag name. This is the reference that will be rebuild.
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
%pre
%p
.light
:plain
Add
curl -X POST \
%strong
variables[VARIABLE]=VALUE
-F token=TOKEN \
to API request.
-F ref=REF_NAME \
The value of variable could then be used to distinguish triggered build from normal one.
#{
builds_trigger_url
(
@project
.
id
)
}
%h3
Use .gitlab-ci.yml
%p
.light
%pre
.append-bottom-0
Copy the snippet to
:plain
%i
.gitlab-ci.yml
curl -X POST \
of dependent project.
-F token=TOKEN \
At the end of your build it will trigger this project to rebuilt.
-F "ref=REF_NAME" \
-F "variables[RUN_NIGHTLY_BUILD]=true" \
%pre
#{
builds_trigger_url
(
@project
.
id
)
}
:plain
trigger:
type: deploy
script:
- "curl -X POST -F token=TOKEN -F ref=REF_NAME
#{
builds_trigger_url
(
@project
.
id
)
}
"
%h3
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
: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