diff options
| author | Jacob Vosmaer <contact@jacobvosmaer.nl> | 2013-11-08 12:15:46 +0100 |
|---|---|---|
| committer | Jacob Vosmaer <contact@jacobvosmaer.nl> | 2013-11-08 12:15:46 +0100 |
| commit | 6c8c9ff5aa117b198d487510b514cc1122cfb2cf (patch) | |
| tree | b18491f61f8252ee3612e542e10128649d68ac1c /lib/gitlab_update.rb | |
| parent | e68025401538eed3a11b6d874c6455acf49ef664 (diff) | |
| download | gitlab-shell-6c8c9ff5aa117b198d487510b514cc1122cfb2cf.tar.gz | |
Bypass shell and use stdlib JSON for GitlabUpdate
Diffstat (limited to 'lib/gitlab_update.rb')
| -rw-r--r-- | lib/gitlab_update.rb | 6 |
1 files changed, 4 insertions, 2 deletions
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 |
