Commit c4791534 authored by Douwe Maan's avatar Douwe Maan

Merge branch 'vzagorodny-master-patch-03209' into 'master'

Refactor "go build" path constants

See merge request gitlab-org/gitlab-shell!328
parents 754e11b7 26351d38
......@@ -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
......@@ -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 = {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment