From db6b64c2ba4f9cee2c911595323356dab8413ce7 Mon Sep 17 00:00:00 2001 From: Isaac Hess Date: Thu, 7 Jan 2021 08:57:42 -0700 Subject: [PATCH] Makefile: Custom gateway location for storj-sim When running make install-sim we currently create a .build directory and init a go module there. This change allows a user to pass in a custom location for this to occur. If nothing is passed in it defaults to current behavior. Change-Id: I432dfc7bae412d8a8454a6b8b3dffece84a41147 --- Makefile | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index efd456539..6236e90f6 100644 --- a/Makefile +++ b/Makefile @@ -73,6 +73,11 @@ build-storagenode-npm: ##@ Simulator +# Allow the caller to set GATEWAYPATH if desired. This controls where the new +# go module is created to install the specific gateway version. +ifndef GATEWAYPATH +GATEWAYPATH=.build/gateway-tmp +endif .PHONY: install-sim install-sim: ## install storj-sim @echo "Running ${@}" @@ -86,9 +91,9 @@ install-sim: ## install storj-sim storj.io/storj/cmd/certificates ## install exact version of storj/gateway - mkdir -p .build/gateway-tmp - -cd .build/gateway-tmp && go mod init gatewaybuild - cd .build/gateway-tmp && GO111MODULE=on go get storj.io/gateway@latest + mkdir -p ${GATEWAYPATH} + -cd ${GATEWAYPATH} && go mod init gatewaybuild + cd ${GATEWAYPATH} && GO111MODULE=on go get storj.io/gateway@latest ##@ Test