summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDouwe Maan <douwe@gitlab.com>2019-09-02 13:58:34 +0000
committerDouwe Maan <douwe@gitlab.com>2019-09-02 13:58:34 +0000
commitc4791534719fc28e2501b4f5d9b5e9a7ca167a5a (patch)
tree2a2b4e4a8cd16e27dba9a1702d0f3a2addd030fd
parent754e11b7188865cf16aae0a9f27d9b16f208f601 (diff)
parent26351d380c3fc9bd3e5b20d5e5fcc90f4cf5c102 (diff)
downloadgitlab-shell-c4791534719fc28e2501b4f5d9b5e9a7ca167a5a.tar.gz
Merge branch 'vzagorodny-master-patch-03209' into 'master'
Refactor "go build" path constants See merge request gitlab-org/gitlab-shell!328
-rwxr-xr-xbin/compile9
-rw-r--r--support/go_build.rb2
2 files changed, 7 insertions, 4 deletions
diff --git a/bin/compile b/bin/compile
index 229b8fd..e6eacca 100755
--- a/bin/compile
+++ b/bin/compile
@@ -5,13 +5,16 @@ require 'fileutils'
require_relative '../support/go_build'
include GoBuild
+BUILD_BIN_GLOB = File.join(BUILD_DIR, 'bin', '*')
+ROOT_BIN = File.join(ROOT_PATH, 'bin')
+
def main
ensure_build_dir_exists
- run!(GO_ENV, %W[go install ./cmd/...], chdir: File.join(ROOT_PATH, GO_DIR))
- executables = Dir[File.join(BUILD_DIR, 'bin', '*')]
+ run!(GO_ENV, %W[go install ./cmd/...], chdir: GO_DIR)
+ executables = Dir[BUILD_BIN_GLOB]
FileUtils.chmod(0755, executables)
- FileUtils.cp(executables, File.join(ROOT_PATH, 'bin'))
+ FileUtils.cp(executables, ROOT_BIN)
end
main
diff --git a/support/go_build.rb b/support/go_build.rb
index 1ef2e17..42e207a 100644
--- a/support/go_build.rb
+++ b/support/go_build.rb
@@ -6,7 +6,7 @@ require 'fileutils'
require_relative '../lib/gitlab_init'
module GoBuild
- GO_DIR = 'go'.freeze
+ GO_DIR = File.join(ROOT_PATH, 'go')
BUILD_DIR = File.join(ROOT_PATH, 'go_build')
GO_ENV = {