diff options
author | Jacob Vosmaer <contact@jacobvosmaer.nl> | 2014-09-22 15:02:46 +0200 |
---|---|---|
committer | Jacob Vosmaer <contact@jacobvosmaer.nl> | 2014-09-22 15:02:46 +0200 |
commit | 4f61061cfbf5a3917442c7e0a971099cf0f9a0a9 (patch) | |
tree | 44cd6853fccb9f30f2aed517e126913b9940f0f4 /lib/tasks | |
parent | 2fc6f8f2cb18a441b777d35c21f5e6d1f066a4d6 (diff) | |
download | gitlab-ce-4f61061cfbf5a3917442c7e0a971099cf0f9a0a9.tar.gz |
Support sockets in 'rake gitlab:shell:install'
Diffstat (limited to 'lib/tasks')
-rw-r--r-- | lib/tasks/gitlab/shell.rake | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/lib/tasks/gitlab/shell.rake b/lib/tasks/gitlab/shell.rake index ece3ad58385..71716ae1856 100644 --- a/lib/tasks/gitlab/shell.rake +++ b/lib/tasks/gitlab/shell.rake @@ -24,8 +24,6 @@ namespace :gitlab do Dir.chdir(target_dir) do sh "git fetch origin && git reset --hard $(git describe #{args.tag} || git describe origin/#{args.tag})" - redis_url = URI.parse(ENV['REDIS_URL'] || "redis://localhost:6379") - config = { user: user, gitlab_url: gitlab_url, @@ -34,14 +32,21 @@ namespace :gitlab do auth_file: File.join(home_dir, ".ssh", "authorized_keys"), redis: { bin: %x{which redis-cli}.chomp, - host: redis_url.host, - port: redis_url.port, namespace: "resque:gitlab" }.stringify_keys, log_level: "INFO", audit_usernames: false }.stringify_keys + redis_url = URI.parse(ENV['REDIS_URL'] || "redis://localhost:6379") + + if redis_url.scheme == 'unix' + config['redis']['socket'] = redis_url.path + else + config['redis']['host'] = redis_url.host + config['redis']['port'] = redis_url.port + end + # Generate config.yml based on existing gitlab settings File.open("config.yml", "w+") {|f| f.puts config.to_yaml} |