summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorAlejandro Rodríguez <alejorro70@gmail.com>2017-11-21 17:45:36 +0000
committerRémy Coutable <remy@rymai.me>2017-11-21 17:45:36 +0000
commitc33ca9d807a70be51afea2692b7191d7790edd6e (patch)
tree125b9266acef5be999118c83f8e82c71313dd4f6 /lib
parent4ebe69600fd7ae9da6fb419d76dd5267d9c3b8ca (diff)
downloadgitlab-ce-c33ca9d807a70be51afea2692b7191d7790edd6e.tar.gz
Use `make install` for Gitaly setups in non-test environments
Diffstat (limited to 'lib')
-rw-r--r--lib/tasks/gitlab/gitaly.rake11
1 files changed, 8 insertions, 3 deletions
diff --git a/lib/tasks/gitlab/gitaly.rake b/lib/tasks/gitlab/gitaly.rake
index 87835dbe719..f2002d7a426 100644
--- a/lib/tasks/gitlab/gitaly.rake
+++ b/lib/tasks/gitlab/gitaly.rake
@@ -14,8 +14,10 @@ namespace :gitlab do
checkout_or_clone_version(version: version, repo: args.repo, target_dir: args.dir)
+ command = %w[/usr/bin/env -u RUBYOPT -u BUNDLE_GEMFILE]
+
_, status = Gitlab::Popen.popen(%w[which gmake])
- command = status.zero? ? ['gmake'] : ['make']
+ command << (status.zero? ? 'gmake' : 'make')
command << 'BUNDLE_FLAGS=--no-deployment' if Rails.env.test?
@@ -23,7 +25,7 @@ namespace :gitlab do
create_gitaly_configuration
# In CI we run scripts/gitaly-test-build instead of this command
unless ENV['CI'].present?
- Bundler.with_original_env { run_command!(%w[/usr/bin/env -u RUBYOPT -u BUNDLE_GEMFILE] + command) }
+ Bundler.with_original_env { run_command!(command) }
end
end
end
@@ -80,9 +82,12 @@ namespace :gitlab do
end
def create_gitaly_configuration
- File.open("config.toml", "w") do |f|
+ File.open("config.toml", File::WRONLY | File::CREAT | File::EXCL) do |f|
f.puts gitaly_configuration_toml
end
+ rescue Errno::EEXIST
+ puts "Skipping config.toml generation:"
+ puts "A configuration file already exists."
rescue ArgumentError => e
puts "Skipping config.toml generation:"
puts e.message