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
27fe2ea5
Commit
27fe2ea5
authored
Sep 16, 2014
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'redis-sockets' into 'master'
Connect to Redis via sockets by default See merge request !41
parents
4f3f3bee
17dab64a
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
35 additions
and
21 deletions
+35
-21
CHANGELOG
CHANGELOG
+1
-0
config.yml.example
config.yml.example
+3
-3
spec/gitlab_config_spec.rb
spec/gitlab_config_spec.rb
+31
-18
No files found.
CHANGELOG
View file @
27fe2ea5
...
...
@@ -4,6 +4,7 @@ v2.0.0
- Handle invalid number of arguments on remote commands
- Replace update hook with pre-receive and post-receive hooks.
- Ignore missing repositories in create-hooks
- Connect to Redis via sockets by default
v1.9.7
- Increased test coverage
...
...
config.yml.example
View file @
27fe2ea5
...
...
@@ -27,11 +27,11 @@ 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
#
host: 127.0.0.1
#
port: 6379
# pass: redispass # Allows you to specify the password for Redis
# socket: /tmp/redis.socket # Only define this if you want to use sockets
database: 0
socket: /var/run/redis/redis.sock # Comment out this line if you want to use TCP
namespace: resque:gitlab
# Log file.
...
...
spec/gitlab_config_spec.rb
View file @
27fe2ea5
...
...
@@ -5,20 +5,27 @@ describe GitlabConfig do
let
(
:config
)
{
GitlabConfig
.
new
}
describe
:redis
do
subject
{
config
.
redis
}
it
{
should
be_a
(
Hash
)
}
it
{
should
have_key
(
'bin'
)
}
it
{
should
have_key
(
'host'
)
}
it
{
should
have_key
(
'port'
)
}
it
{
should
have_key
(
'database'
)
}
it
{
should
have_key
(
'namespace'
)
}
end
describe
:redis_namespace
do
subject
{
config
.
redis_namespace
}
before
do
config
.
instance_variable_set
(
:@config
,
YAML
.
load
(
<<
eos
redis:
bin: /usr/bin/redis-cli
host: 127.0.1.1
port: 6378
pass: secure
database: 1
socket: /var/run/redis/redis.sock
namespace: my:gitlab
eos
))
end
it
{
should
eq
(
'resque:gitlab'
)
}
it
{
config
.
redis
[
'bin'
].
should
eq
(
'/usr/bin/redis-cli'
)
}
it
{
config
.
redis
[
'host'
].
should
eq
(
'127.0.1.1'
)
}
it
{
config
.
redis
[
'port'
].
should
eq
(
6378
)
}
it
{
config
.
redis
[
'database'
].
should
eq
(
1
)
}
it
{
config
.
redis
[
'namespace'
].
should
eq
(
'my:gitlab'
)
}
it
{
config
.
redis
[
'socket'
].
should
eq
(
'/var/run/redis/redis.sock'
)
}
it
{
config
.
redis
[
'pass'
].
should
eq
(
'secure'
)
}
end
describe
:gitlab_url
do
...
...
@@ -39,11 +46,6 @@ describe GitlabConfig do
describe
:redis_command
do
subject
{
config
.
redis_command
}
it
{
should
be_an
(
Array
)
}
it
{
should
include
(
config
.
redis
[
'host'
])
}
it
{
should
include
(
config
.
redis
[
'bin'
])
}
it
{
should
include
(
config
.
redis
[
'port'
].
to_s
)
}
context
"with empty redis config"
do
before
do
config
.
stub
(
:redis
)
{
{}
}
...
...
@@ -53,6 +55,17 @@ describe GitlabConfig do
it
{
should
include
(
'redis-cli'
)
}
end
context
"with host and port"
do
before
do
config
.
stub
(
:redis
)
{
{
'host'
=>
'localhost'
,
'port'
=>
1123
,
'bin'
=>
'/usr/bin/redis-cli'
}
}
end
it
{
should
be_an
(
Array
)
}
it
{
should
include
(
config
.
redis
[
'host'
])
}
it
{
should
include
(
config
.
redis
[
'bin'
])
}
it
{
should
include
(
config
.
redis
[
'port'
].
to_s
)
}
end
context
"with redis socket"
do
let
(
:socket
)
{
'/tmp/redis.socket'
}
before
do
...
...
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