diff options
Diffstat (limited to '_support/test-boot')
-rwxr-xr-x | _support/test-boot | 29 |
1 files changed, 22 insertions, 7 deletions
diff --git a/_support/test-boot b/_support/test-boot index 4a9be6709..67be87553 100755 --- a/_support/test-boot +++ b/_support/test-boot @@ -2,14 +2,21 @@ require 'tempfile' require 'socket' +require 'optparse' ADDR = 'socket'.freeze -def main(gitaly_dir) - gitaly_dir = File.realpath(gitaly_dir) +def main(params) + gitaly_dir = File.realpath(params[:dir]) build_dir = File.join(gitaly_dir, '_build') bin_dir = File.join(build_dir, 'bin') - git_path = File.join(build_dir, 'deps', 'git', 'install', 'bin', 'git') + + git_path, use_bundled_git = + if params[:"bundled-git"] + ["", true] + else + [File.join(build_dir, 'deps', 'git', 'install', 'bin', 'git'), false] + end version = IO.popen("#{File.join(bin_dir, 'gitaly')} -version").read.delete_prefix('Gitaly, version ').strip version_from_file = IO.read(File.join(gitaly_dir, 'VERSION')).strip @@ -35,6 +42,7 @@ def main(gitaly_dir) path = "#{dir}" [git] + use_bundled_binaries = #{use_bundled_git} bin_path = "#{git_path}" [gitaly-ruby] @@ -85,8 +93,15 @@ def wait_connect abort end -unless ARGV.count == 1 - abort "Usage: #{$PROGRAM_NAME} GITALY_DIR" -end +params = {} +OptionParser.new do |parser| + parser.banner = "Usage: #{$PROGRAM_NAME} [options] <GITALY_DIR>" + parser.on('--[no-]bundled-git', 'Set up Gitaly with bundled Git binaries') +end.parse!(into: params) + +params[:dir] = ARGV.pop +abort "Gitaly source directory not provided" if params[:dir].nil? + +abort "Extra arguments" unless ARGV.count == 0 -main(ARGV.first) +main(params) |