BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
473445c7
Commit
473445c7
authored
Jan 08, 2012
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
complete hooks for post receive
parent
57ac5fe9
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
64 additions
and
5 deletions
+64
-5
.foreman
.foreman
+1
-1
projects_controller.rb
app/controllers/projects_controller.rb
+1
-1
repositories_controller.rb
app/controllers/repositories_controller.rb
+1
-1
_data_ex.html.erb
app/views/hooks/_data_ex.html.erb
+42
-0
index.html.haml
app/views/hooks/index.html.haml
+14
-0
show.html.haml
app/views/hooks/show.html.haml
+4
-1
database.yml
config/database.yml
+1
-1
No files found.
.foreman
View file @
473445c7
port:
9999
port:
3000
app/controllers/projects_controller.rb
View file @
473445c7
...
@@ -68,7 +68,7 @@ class ProjectsController < ApplicationController
...
@@ -68,7 +68,7 @@ class ProjectsController < ApplicationController
def
show
def
show
return
render
"projects/empty"
unless
@project
.
repo_exists?
&&
@project
.
has_commits?
return
render
"projects/empty"
unless
@project
.
repo_exists?
&&
@project
.
has_commits?
limit
=
(
params
[
:limit
]
||
1
0
).
to_i
limit
=
(
params
[
:limit
]
||
2
0
).
to_i
@activities
=
@project
.
cached_updates
(
limit
)
@activities
=
@project
.
cached_updates
(
limit
)
end
end
...
...
app/controllers/repositories_controller.rb
View file @
473445c7
...
@@ -9,7 +9,7 @@ class RepositoriesController < ApplicationController
...
@@ -9,7 +9,7 @@ class RepositoriesController < ApplicationController
layout
"project"
layout
"project"
def
show
def
show
@activities
=
@project
.
fresh_commits
(
1
0
)
@activities
=
@project
.
fresh_commits
(
2
0
)
end
end
def
branches
def
branches
...
...
app/views/hooks/_data_ex.html.erb
0 → 100644
View file @
473445c7
<%
data_ex_str
=
<<
eos
{
:before => "95790bf891e76fee5e1747ab589903a6a1f80f22",
:after => "da1560886d4f094c3e6c9ef40349f7d38b5d27d7",
:ref => "refs/heads/master",
:repository => {
:name => "Diaspora",
:url => "localhost/diaspora",
:description => "",
:homepage => "localhost/diaspora",
:private => true
},
:commits => [
[0] {
:id => "450d0de7532f8b663b9c5cce183b...",
:message => "Update Catalan translation to e38cb41.",
:timestamp => "2011-12-12T14:27:31+02:00",
:url => "http://localhost/diaspora/commits/450d0de7532f...",
:author => {
:name => "Jordi Mallach",
:email => "jordi@softcatala.org"
}
},
....
[3] {
:id => "da1560886d4f094c3e6c9ef40349...",
:message => "fixed readme",
:timestamp => "2012-01-03T23:36:29+02:00",
:url => "http://localhost/diaspora/commits/da1560886d...",
:author => {
:name => "gitlab dev user",
:email => "gitlabdev@dv6700.(none)"
}
}
]
}
eos
%>
<%
js_lexer
=
Pygments
::
Lexer
[
:js
]
%>
<%=
raw
js_lexer
.
highlight
(
data_ex_str
)
%>
app/views/hooks/index.html.haml
View file @
473445c7
=
render
"repositories/head"
=
render
"repositories/head"
.right
=
link_to
"Add new"
,
new_project_hook_path
(
@project
),
:class
=>
"grey-button append-bottom-10"
.right
=
link_to
"Add new"
,
new_project_hook_path
(
@project
),
:class
=>
"grey-button append-bottom-10"
-
unless
@hooks
.
empty?
-
unless
@hooks
.
empty?
%div
.update-data.ui-box.ui-box-small
%div
.update-data.ui-box.ui-box-small
...
@@ -14,3 +18,13 @@
...
@@ -14,3 +18,13 @@
-
else
-
else
%h3
No hooks
%h3
No hooks
.clear
%h3
Help
%p
Post receive hooks. For now only POST request allowed. We send some data with request. Example below
.view_file
.view_file_header
%strong
POST data passed
.data.no-padding
=
render
"data_ex"
app/views/hooks/show.html.haml
View file @
473445c7
=
render
"repositories/head"
=
render
"repositories/head"
%h3
=
@hook
.
url
%h3
%span
.commit.tag
POST
=
@hook
.
url
-
if
can?
current_user
,
:admin_project
,
@project
-
if
can?
current_user
,
:admin_project
,
@project
.merge-tabs
.merge-tabs
...
...
config/database.yml
View file @
473445c7
...
@@ -20,6 +20,6 @@ test:
...
@@ -20,6 +20,6 @@ test:
production
:
production
:
adapter
:
sqlite3
adapter
:
sqlite3
database
:
db/
production
.sqlite3
database
:
db/
development
.sqlite3
pool
:
5
pool
:
5
timeout
:
5000
timeout
:
5000
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