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
8d84906b
Commit
8d84906b
authored
Nov 20, 2013
by
Jacob Vosmaer
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #109 from jsternberg/master
Display error and send failure exit status if redis-cli fails
parents
6fc922c2
acab321d
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
5 deletions
+14
-5
bin/check
bin/check
+9
-3
lib/gitlab_update.rb
lib/gitlab_update.rb
+5
-2
No files found.
bin/check
View file @
8d84906b
...
...
@@ -12,13 +12,13 @@ resp = GitlabNet.new.check
if
resp
.
code
==
"200"
print
'OK'
else
puts
"FAILED. code:
#{
resp
.
code
}
"
abort
"FAILED. code:
#{
resp
.
code
}
"
end
puts
"
\n
Check directories and files: "
config
=
GitlabConfig
.
new
dirs
=
[
config
.
repos_path
,
config
.
auth_file
,
config
.
redis
[
'bin'
]
]
dirs
=
[
config
.
repos_path
,
config
.
auth_file
]
dirs
.
each
do
|
dir
|
abort
(
"ERROR: missing option in config.yml"
)
unless
dir
...
...
@@ -26,7 +26,13 @@ dirs.each do |dir|
if
File
.
exists?
(
dir
)
print
'OK'
else
puts
"FAILED"
abort
"FAILED"
end
puts
"
\n
"
end
print
"Test redis-cli executable: "
abort
(
'FAILED'
)
unless
system
(
*
config
.
redis_command
,
'--version'
)
print
"Send ping to redis server: "
abort
unless
system
(
*
config
.
redis_command
,
'ping'
)
lib/gitlab_update.rb
View file @
8d84906b
...
...
@@ -34,7 +34,7 @@ class GitlabUpdate
update_redis
exit
0
else
puts
"GitLab: You are not allowed to access
#{
@branch_name
}
!
"
puts
"GitLab: You are not allowed to access
#{
@branch_name
}
!"
exit
1
end
else
...
...
@@ -56,6 +56,9 @@ class GitlabUpdate
def
update_redis
queue
=
"
#{
config
.
redis_namespace
}
:queue:post_receive"
msg
=
JSON
.
dump
({
'class'
=>
'PostReceive'
,
'args'
=>
[
@repo_path
,
@oldrev
,
@newrev
,
@refname
,
@key_id
]})
system
(
*
config
.
redis_command
,
'rpush'
,
queue
,
msg
,
err:
'/dev/null'
,
out:
'/dev/null'
)
unless
system
(
*
config
.
redis_command
,
'rpush'
,
queue
,
msg
,
err:
'/dev/null'
,
out:
'/dev/null'
)
puts
"GitLab: An unexpected error occurred (redis-cli returned
#{
$?
.
exitstatus
}
)."
exit
1
end
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