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
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
nexedi
gitlab-shell
Commits
93bfff7b
Commit
93bfff7b
authored
Mar 29, 2013
by
Chris
Committed by
Chr1831
Mar 29, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added remote redis support to gitlab_update.rb
parent
ff484e65
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
1 deletion
+17
-1
config.yml.example
config.yml.example
+8
-0
lib/gitlab_config.rb
lib/gitlab_config.rb
+4
-0
lib/gitlab_update.rb
lib/gitlab_update.rb
+5
-1
No files found.
config.yml.example
View file @
93bfff7b
...
...
@@ -14,3 +14,11 @@ repos_path: "/home/git/repositories"
# File used as authorized_keys for gitlab user
auth_file: "/home/git/.ssh/authorized_keys"
# Redis settings used for pushing commit notices to gitlab
redis:
bin: /usr/bin/redis-cli
host: 127.0.0.1
port: 6379
namespace: resque:gitlab
lib/gitlab_config.rb
View file @
93bfff7b
...
...
@@ -22,4 +22,8 @@ class GitlabConfig
def
http_settings
@config
[
'http_settings'
]
||=
{}
end
def
redis
@config
[
'redis'
]
||=
{}
end
end
lib/gitlab_update.rb
View file @
93bfff7b
...
...
@@ -15,6 +15,8 @@ class GitlabUpdate
@oldrev
=
ARGV
[
1
]
@newrev
=
ARGV
[
2
]
@redis
=
GitlabConfig
.
new
.
redis
end
def
exec
...
...
@@ -49,7 +51,9 @@ class GitlabUpdate
end
def
update_redis
command
=
"env -i redis-cli rpush 'resque:gitlab:queue:post_receive' '{
\"
class
\"
:
\"
PostReceive
\"
,
\"
args
\"
:[
\"
#{
@repo_path
}
\"
,
\"
#{
@oldrev
}
\"
,
\"
#{
@newrev
}
\"
,
\"
#{
@refname
}
\"
,
\"
#{
@key_id
}
\"
]}' > /dev/null 2>&1"
command
=
"
#{
@redis
[
'bin'
]
}
-h
#{
@redis
[
'host'
]
}
-p
#{
@redis
[
'port'
]
}
rpush '
#{
@redis
[
'namespace'
]
}
:queue:post_receive' "
+
"'{
\"
class
\"
:
\"
PostReceive
\"
,
\"
args
\"
:[
\"
#{
@repo_path
}
\"
,
\"
#{
@oldrev
}
\"
,
\"
#{
@newrev
}
\"
,
\"
#{
@refname
}
\"
,
\"
#{
@key_id
}
\"
]}' > /dev/null 2>&1"
system
(
command
)
end
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