diff options
author | Jacob Vosmaer <jacob@gitlab.com> | 2017-04-28 18:16:55 +0200 |
---|---|---|
committer | Jacob Vosmaer <jacob@gitlab.com> | 2017-05-23 15:26:35 +0200 |
commit | 25a32cfa1e0b1c7e6af723053bad0f432ffd0b32 (patch) | |
tree | bc6d2958eeedb0b0c15d329ec90cc6d0d90cb919 /bin | |
parent | 285c061ed8933c0d94a9ad027f99653039673324 (diff) | |
download | gitlab-shell-25a32cfa1e0b1c7e6af723053bad0f432ffd0b32.tar.gz |
Use gitaly-upload-pack and gitaly-receive-pack
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/compile | 29 |
1 files changed, 5 insertions, 24 deletions
diff --git a/bin/compile b/bin/compile index faf3e4c..fc5fb6c 100755 --- a/bin/compile +++ b/bin/compile @@ -2,35 +2,16 @@ require 'fileutils' -# This will set the ROOT_PATH variable -require_relative '../lib/gitlab_init' - -GO_DIR = 'go' -BUILD_DIR = File.join(ROOT_PATH, 'go_build') -GO_PACKAGE = File.join('gitlab.com/gitlab-org/gitlab-shell', GO_DIR) +require_relative '../support/go_build' +include GoBuild def main - FileUtils.rm_rf(BUILD_DIR) - build_source_dir = File.join(BUILD_DIR, 'src', GO_PACKAGE) - FileUtils.mkdir_p(build_source_dir) - FileUtils.cp_r(File.join(ROOT_PATH, GO_DIR, '.'), build_source_dir) - env = { - 'GOPATH' => BUILD_DIR, - 'GO15VENDOREXPERIMENT' => '1', - } - run!(env, %W[go install #{GO_PACKAGE}/cmd/...]) + create_fresh_build_dir + + run!(GO_ENV, %W[go install #{GO_PACKAGE}/cmd/...]) executables = Dir[File.join(BUILD_DIR, 'bin', '*')] FileUtils.chmod(0755, executables) FileUtils.cp(executables, File.join(ROOT_PATH, 'bin')) end -def run!(env, cmd) - raise "env must be a hash" unless env.is_a?(Hash) - raise "cmd must be an array" unless cmd.is_a?(Array) - - if !system(env, *cmd) - abort "command failed: #{env.inspect} #{cmd.join(' ')}" - end -end - main |