summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/gitlab_config.rb6
-rw-r--r--lib/gitlab_update.rb6
2 files changed, 7 insertions, 5 deletions
diff --git a/lib/gitlab_config.rb b/lib/gitlab_config.rb
index 9dc5c66..ad15247 100644
--- a/lib/gitlab_config.rb
+++ b/lib/gitlab_config.rb
@@ -48,12 +48,12 @@ class GitlabConfig
if redis.empty?
# Default to old method of connecting to redis
# for users that haven't updated their configuration
- "env -i redis-cli"
+ %W(env -i redis-cli)
else
if redis.has_key?("socket")
- "#{redis['bin']} -s #{redis['socket']}"
+ %W(#{redis['bin']} -s #{redis['socket']})
else
- "#{redis['bin']} -h #{redis['host']} -p #{redis['port']}"
+ %W(#{redis['bin']} -h #{redis['host']} -p #{redis['port']})
end
end
end
diff --git a/lib/gitlab_update.rb b/lib/gitlab_update.rb
index 40ddc6e..038253a 100644
--- a/lib/gitlab_update.rb
+++ b/lib/gitlab_update.rb
@@ -1,5 +1,6 @@
require_relative 'gitlab_init'
require_relative 'gitlab_net'
+require 'json'
class GitlabUpdate
attr_reader :config
@@ -53,7 +54,8 @@ class GitlabUpdate
end
def update_redis
- command = "#{config.redis_command} rpush '#{config.redis_namespace}:queue:post_receive' '{\"class\":\"PostReceive\",\"args\":[\"#{@repo_path}\",\"#{@oldrev}\",\"#{@newrev}\",\"#{@refname}\",\"#{@key_id}\"]}' > /dev/null 2>&1"
- system(command)
+ 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')
end
end