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
Tatuya Kamada
gitlab-ce
Commits
cf5d3bb0
Commit
cf5d3bb0
authored
Dec 03, 2013
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improve help page for Project web hooks
Signed-off-by:
Dmitriy Zaporozhets
<
dmitriy.zaporozhets@gmail.com
>
parent
887c0c67
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
68 additions
and
53 deletions
+68
-53
app/helpers/application_helper.rb
app/helpers/application_helper.rb
+8
-0
app/views/help/web_hooks.html.haml
app/views/help/web_hooks.html.haml
+60
-9
app/views/projects/hooks/_data_ex.html.erb
app/views/projects/hooks/_data_ex.html.erb
+0
-44
No files found.
app/helpers/application_helper.rb
View file @
cf5d3bb0
...
...
@@ -207,4 +207,12 @@ module ApplicationHelper
def
broadcast_message
BroadcastMessage
.
current
end
def
highlight_js
(
&
block
)
string
=
capture
(
&
block
)
content_tag
:div
,
class:
user_color_scheme_class
do
Pygments
::
Lexer
[
:js
].
highlight
(
string
).
html_safe
end
end
end
app/views/help/web_hooks.html.haml
View file @
cf5d3bb0
...
...
@@ -4,21 +4,68 @@
Project web hooks allow you to trigger url if new code is pushed or new issue is created
%hr
%p
%p
.slead
You can configure web hook to listen for specific events like pushes, issues, merge requests.
%br
GitLab will send POST request with data to web hook url.
%br
Web Hooks can be used to update an external issue tracker, trigger CI builds, update a backup mirror, or even deploy to your production server.
%hr
%h4
Push events
=
render
"projects/hooks/data_ex"
%p
.light
Triggered when you push to the repository except pushing tags.
%br
Request body:
=
highlight_js
do
:erb
{
"before": "95790bf891e76fee5e1747ab589903a6a1f80f22",
"after": "da1560886d4f094c3e6c9ef40349f7d38b5d27d7",
"ref": "refs/heads/master",
"user_id": 4,
"user_name": "John Smith",
"project_id": 15,
"repository": {
"name": "Diaspora",
"url": "git@localhost:diaspora.git",
"description": "",
"homepage": "http://localhost/diaspora",
},
"commits": [
{
"id": "b6568db1bc1dcd7f8b4d5a946b0b91f9dacd7327",
"message": "Update Catalan translation to e38cb41.",
"timestamp": "2011-12-12T14:27:31+02:00",
"url": "http://localhost/diaspora/commits/b6568db1bc1dcd7f8b4d5a946b0b91f9dacd7327",
"author": {
"name": "Jordi Mallach",
"email": "jordi@softcatala.org",
}
},
// ...
{
"id": "da1560886d4f094c3e6c9ef40349f7d38b5d27d7",
"message": "fixed readme",
"timestamp": "2012-01-03T23:36:29+02:00",
"url": "http://localhost/diaspora/commits/da1560886d4f094c3e6c9ef40349f7d38b5d27d7",
"author": {
"name": "GitLab dev user",
"email": "gitlabdev@dv6700.(none)",
},
},
],
"total_commits_count": 4,
};
%h4
Issues events
%pre
:preserve
%h4
.prepend-top-20
Issues events
%p
.light
Triggered when new issue created or existing issue was closed.
%br
Request body:
=
highlight_js
do
:erb
{
"object_kind":"issue",
"object_attributes":{
...
...
@@ -37,9 +84,13 @@
"iid":23
}
}
%h4
Merge request events
%pre
:preserve
%h4
.prepend-top-20
Merge request events
%p
.light
Triggered when new merge request created or existing merge request was merged/closed.
%br
Request body:
=
highlight_js
do
:erb
{
"object_kind":"merge_request",
"object_attributes":{
...
...
app/views/projects/hooks/_data_ex.html.erb
deleted
100644 → 0
View file @
887c0c67
<%
data_ex_str
=
<<
eos
{
"before": "95790bf891e76fee5e1747ab589903a6a1f80f22",
"after": "da1560886d4f094c3e6c9ef40349f7d38b5d27d7",
"ref": "refs/heads/master",
"user_id": 4,
"user_name": "John Smith",
"project_id": 15,
"repository": {
"name": "Diaspora",
"url": "git@localhost:diaspora.git",
"description": "",
"homepage": "http://localhost/diaspora",
},
"commits": [
{
"id": "b6568db1bc1dcd7f8b4d5a946b0b91f9dacd7327",
"message": "Update Catalan translation to e38cb41.",
"timestamp": "2011-12-12T14:27:31+02:00",
"url": "http://localhost/diaspora/commits/b6568db1bc1dcd7f8b4d5a946b0b91f9dacd7327",
"author": {
"name": "Jordi Mallach",
"email": "jordi@softcatala.org",
}
},
// ...
{
"id": "da1560886d4f094c3e6c9ef40349f7d38b5d27d7",
"message": "fixed readme",
"timestamp": "2012-01-03T23:36:29+02:00",
"url": "http://localhost/diaspora/commits/da1560886d4f094c3e6c9ef40349f7d38b5d27d7",
"author": {
"name": "GitLab dev user",
"email": "gitlabdev@dv6700.(none)",
},
},
],
"total_commits_count": 4,
};
eos
%>
<div
class=
"
<%=
user_color_scheme_class
%>
"
>
<%=
raw
Pygments
::
Lexer
[
:js
].
highlight
(
data_ex_str
)
%>
</div>
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