Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-shell
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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kirill Smelkov
gitlab-shell
Commits
c2bf1061
Commit
c2bf1061
authored
Feb 04, 2013
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
link post-receive hook also
parent
4908b894
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
2 deletions
+15
-2
hooks/post-receive
hooks/post-receive
+12
-0
lib/gitlab_projects.rb
lib/gitlab_projects.rb
+3
-2
No files found.
hooks/post-receive
0 → 100644
View file @
c2bf1061
#!/usr/bin/env bash
# Version 4.1
# This file was placed here by GitLab. It makes sure that your pushed commits
# will be processed properly.
while
read
oldrev newrev ref
do
# For every branch or tag that was pushed, create a Resque job in redis.
repo_path
=
`
pwd
`
env
-i
redis-cli rpush
"resque:gitlab:queue:post_receive"
"{
\"
class
\"
:
\"
PostReceive
\"
,
\"
args
\"
:[
\"
$repo_path
\"
,
\"
$oldrev
\"
,
\"
$newrev
\"
,
\"
$ref
\"
,
\"
$GL_USER
\"
]}"
>
/dev/null 2>&1
done
lib/gitlab_projects.rb
View file @
c2bf1061
...
...
@@ -10,6 +10,7 @@ class GitlabProjects
@project_name
=
ARGV
.
shift
@repos_path
=
GitlabConfig
.
new
.
repos_path
@full_path
=
File
.
join
(
@repos_path
,
@project_name
)
@hook_path
=
File
.
join
(
ROOT_PATH
,
'hooks'
,
'post-receive'
)
end
def
exec
...
...
@@ -24,8 +25,8 @@ class GitlabProjects
protected
def
add_project
FileUtils
.
mkdir_p
(
@full_path
,
mode:
0770
)
cmd
=
"cd
#{
@full_path
}
&& git init --bare"
FileUtils
.
mkdir_p
(
@full_path
,
mode:
0770
)
cmd
=
"cd
#{
@full_path
}
&& git init --bare
&& ln -s
#{
@hook_path
}
#{
@full_path
}
/hooks/post-receive
"
system
(
cmd
)
end
...
...
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