Browse code

Refactored scripts to use new methods for $GOPATH binaries

As binaries in the $GOPATH will not be places in $PATH for scripts,
we need to keep the old method of ensuring that binaries exist in the
correct place and then using the absolute paths to those binaries to
invoke them.

Signed-off-by: Steve Kuznetsov <skuznets@redhat.com>

Steve Kuznetsov authored on 2016/11/08 01:22:28
Showing 2 changed files
... ...
@@ -7,14 +7,13 @@ os::build::setup_env
7 7
 EXAMPLES=examples
8 8
 OUTPUT_PARENT=${OUTPUT_ROOT:-$OS_ROOT}
9 9
 
10
-if [[ -z "$( which go-bindata )" ]]; then
11
-  pushd vendor/github.com/jteeuwen/go-bindata > /dev/null
12
-    go install ./...
13
-  popd > /dev/null
14
-fi
10
+pushd vendor/github.com/jteeuwen/go-bindata > /dev/null
11
+  go install ./...
12
+popd > /dev/null
13
+os::util::ensure::gopath_binary_exists 'go-bindata'
15 14
 
16 15
 pushd "${OS_ROOT}" > /dev/null
17
-"$(os::util::find-go-binary go-bindata)" \
16
+"$(os::util::find::gopath_binary go-bindata)" \
18 17
     -nocompress \
19 18
     -nometadata \
20 19
     -prefix "bootstrap" \
... ...
@@ -22,6 +22,7 @@ echo "Making sure go-bindata binary has been built..."
22 22
 pushd vendor/github.com/jteeuwen/go-bindata > /dev/null
23 23
   go install ./...
24 24
 popd > /dev/null
25
+os::util::ensure::gopath_binary_exists 'go-bindata'
25 26
 
26 27
 if [[ -z "${GIT_REF:+x}" ]]; then
27 28
   echo "No git ref specified, using current state of the repo including any unstaged changes...";
... ...
@@ -44,8 +45,8 @@ pushd "${OS_ROOT}" > /dev/null
44 44
   # Put each component in its own go package for compilation performance
45 45
   # Strip off the dist folder from each package to flatten the resulting directory structure
46 46
   # Force timestamps to unify, and mode to 493 (0755)
47
-  "$(os::util::find-go-binary go-bindata)" -nocompress -nometadata -prefix "${CONSOLE_REPO_PATH}/dist"      -pkg "assets" -o "pkg/assets/bindata.go"      "${CONSOLE_REPO_PATH}/dist/..."
48
-  "$(os::util::find-go-binary go-bindata)" -nocompress -nometadata -prefix "${CONSOLE_REPO_PATH}/dist.java" -pkg "java"   -o "pkg/assets/java/bindata.go" "${CONSOLE_REPO_PATH}/dist.java/..."
47
+  "$(os::util::find::gopath_binary go-bindata)" -nocompress -nometadata -prefix "${CONSOLE_REPO_PATH}/dist"      -pkg "assets" -o "pkg/assets/bindata.go"      "${CONSOLE_REPO_PATH}/dist/..."
48
+  "$(os::util::find::gopath_binary go-bindata)" -nocompress -nometadata -prefix "${CONSOLE_REPO_PATH}/dist.java" -pkg "java"   -o "pkg/assets/java/bindata.go" "${CONSOLE_REPO_PATH}/dist.java/..."
49 49
 
50 50
   if [[ -n "${COMMIT:+x}" ]]; then
51 51
     if [[ -n "$(git status --porcelain)" ]]; then