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
Kazuhiko Shiozaki
gitlab-shell
Commits
4228aaca
Commit
4228aaca
authored
Aug 24, 2014
by
Tao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
support using custom redis database, fixes #173
parent
24dda4a8
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
3 deletions
+6
-3
config.yml.example
config.yml.example
+1
-0
lib/gitlab_config.rb
lib/gitlab_config.rb
+4
-3
spec/gitlab_config_spec.rb
spec/gitlab_config_spec.rb
+1
-0
No files found.
config.yml.example
View file @
4228aaca
...
@@ -31,6 +31,7 @@ redis:
...
@@ -31,6 +31,7 @@ redis:
port: 6379
port: 6379
# pass: redispass # Allows you to specify the password for Redis
# pass: redispass # Allows you to specify the password for Redis
# socket: /tmp/redis.socket # Only define this if you want to use sockets
# socket: /tmp/redis.socket # Only define this if you want to use sockets
database: 0
namespace: resque:gitlab
namespace: resque:gitlab
# Log file.
# Log file.
...
...
lib/gitlab_config.rb
View file @
4228aaca
...
@@ -54,13 +54,14 @@ class GitlabConfig
...
@@ -54,13 +54,14 @@ class GitlabConfig
# for users that haven't updated their configuration
# for users that haven't updated their configuration
%W(env -i redis-cli)
%W(env -i redis-cli)
else
else
redis
[
'database'
]
||=
0
if
redis
.
has_key?
(
"socket"
)
if
redis
.
has_key?
(
"socket"
)
%W(
#{
redis
[
'bin'
]
}
-s
#{
redis
[
'socket'
]
}
)
%W(
#{
redis
[
'bin'
]
}
-s
#{
redis
[
'socket'
]
}
-n
#{
redis
[
'database'
]
}
)
else
else
if
redis
.
has_key?
(
"pass"
)
if
redis
.
has_key?
(
"pass"
)
%W(
#{
redis
[
'bin'
]
}
-h
#{
redis
[
'host'
]
}
-p
#{
redis
[
'port'
]
}
-a
#{
redis
[
'pass'
]
}
)
%W(
#{
redis
[
'bin'
]
}
-h
#{
redis
[
'host'
]
}
-p
#{
redis
[
'port'
]
}
-
n
#{
redis
[
'database'
]
}
-
a
#{
redis
[
'pass'
]
}
)
else
else
%W(
#{
redis
[
'bin'
]
}
-h
#{
redis
[
'host'
]
}
-p
#{
redis
[
'port'
]
}
)
%W(
#{
redis
[
'bin'
]
}
-h
#{
redis
[
'host'
]
}
-p
#{
redis
[
'port'
]
}
-n
#{
redis
[
'database'
]
}
)
end
end
end
end
end
end
...
...
spec/gitlab_config_spec.rb
View file @
4228aaca
...
@@ -11,6 +11,7 @@ describe GitlabConfig do
...
@@ -11,6 +11,7 @@ describe GitlabConfig do
it
{
should
have_key
(
'bin'
)
}
it
{
should
have_key
(
'bin'
)
}
it
{
should
have_key
(
'host'
)
}
it
{
should
have_key
(
'host'
)
}
it
{
should
have_key
(
'port'
)
}
it
{
should
have_key
(
'port'
)
}
it
{
should
have_key
(
'database'
)
}
it
{
should
have_key
(
'namespace'
)
}
it
{
should
have_key
(
'namespace'
)
}
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