You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@solr.apache.org by ho...@apache.org on 2021/04/20 18:35:55 UTC

[solr-operator] 02/02: Fix path issue for dependency installation during smoke-test.

This is an automated email from the ASF dual-hosted git repository.

houston pushed a commit to branch rc1-changes
in repository https://gitbox.apache.org/repos/asf/solr-operator.git

commit cc7a4b0b23bb0a32f220c2898b33f6b26eed53fe
Author: Houston Putman <ho...@apache.org>
AuthorDate: Tue Apr 20 13:35:38 2021 -0500

    Fix path issue for dependency installation during smoke-test.
---
 Makefile                               | 2 +-
 hack/install_dependencies.sh           | 9 ++++++++-
 hack/release/smoke_test/test_source.sh | 6 ++++++
 3 files changed, 15 insertions(+), 2 deletions(-)

diff --git a/Makefile b/Makefile
index acaa3dc..623aac1 100644
--- a/Makefile
+++ b/Makefile
@@ -65,7 +65,7 @@ mod-tidy:
 	export GO111MODULE=on; go mod tidy
 
 .install-dependencies:
-	./hack/install_dependencies.sh
+	. ./hack/install_dependencies.sh
 
 install-dependencies: .install-dependencies mod-tidy
 
diff --git a/hack/install_dependencies.sh b/hack/install_dependencies.sh
index 6b366fe..f0fac49 100755
--- a/hack/install_dependencies.sh
+++ b/hack/install_dependencies.sh
@@ -26,6 +26,11 @@ arch=$(go env GOARCH)
 
 # Install go modules 
 GO111MODULE=on go mod tidy
+# Add GOBIN to PATH
+if [[ -z "${GOBIN:-}" ]]; then
+  export GOBIN="${GOPATH:-~/go}/bin"
+fi
+export PATH="${PATH}:${GOBIN}"
 
 #Install Kustomize
 if ! (which kustomize); then
@@ -68,4 +73,6 @@ elif ! (controller-gen --version | grep "Version: ${controller_gen_version}"); t
   echo "Installed controller-gen at $(which controller-gen), version: $(controller-gen --version)"
 else
   echo "controller-gen already installed at $(which controller-gen), version: $(controller-gen --version)"
-fi
\ No newline at end of file
+fi
+
+echo "Make sure to add \$GOBIN or \${GOPATH}/bin to your \$PATH"
diff --git a/hack/release/smoke_test/test_source.sh b/hack/release/smoke_test/test_source.sh
index 3e870f1..5a7aac7 100755
--- a/hack/release/smoke_test/test_source.sh
+++ b/hack/release/smoke_test/test_source.sh
@@ -82,6 +82,12 @@ echo "Download source artifact, verify and run 'make check'"
   tar -xzf "solr-operator-${VERSION}.tgz"
   cd "solr-operator-${VERSION}"
 
+  # Add GOBIN to PATH
+  if [[ -z "${GOBIN:-}" ]]; then
+    export GOBIN="${GOPATH:-~/go}/bin"
+  fi
+  export PATH="${PATH}:${GOBIN}"
+
   # Install the dependencies
   make install-dependencies