From: jcope Date: Mon, 12 Oct 2020 15:42:35 +0000 (-0500) Subject: build output to appropriate dir X-Git-Url: https://gerrit.akraino.org/r/gitweb?a=commitdiff_plain;h=b326fdb38b27e127c6206dd96be8da0691cd4e20;p=kni%2Finstaller.git build output to appropriate dir GOBIN is defined but overridden in go build command. This fix corrects the bug and builds binaries to ./bin. Includes a .gitignore file in ./bin to exclude build artifacts. Replaces hardcoded ./bin paths in other commands with $(GOBIN), else other make targets may not reference the most recent binary. Change-Id: Icc7e0e23fef9ec4f41e5a9660bbf3d21d056deb4 Signed-off-by: jcope --- diff --git a/Makefile b/Makefile index 992623b..f53ba55 100644 --- a/Makefile +++ b/Makefile @@ -43,12 +43,12 @@ binary: build: @echo "Building knictl with $(GOPATH) to knictl.tar.gz" - @GOPATH=$(GOPATH) GOBIN=$(GOBIN) go build -o $(GONAME) $(GOFILES) - tar -czvf knictl.tar.gz $(GONAME) plugins utils + @GOPATH=$(GOPATH) go build -o "$(GOBIN)/$(GONAME)" $(GOFILES) + tar -czvf "$(GOBIN)/knictl.tar.gz" "$(GOBIN)/$(GONAME)" plugins utils clean: @echo "Destroying previous cluster" - @./bin/$(GONAME) clean --build_path $(BUILDDIR) + @"$(GOBIN)/$(GONAME)" clean --build_path $(BUILDDIR) dependencies: @echo "Installing dependencies" @@ -56,12 +56,12 @@ dependencies: deploy: dependencies @echo "Launching cluster deployment bin/$(GONAME)" - @./bin/$(GONAME) generate --installer_path $(INSTALLER_PATH) --build_path $(BUILDDIR) --base_repository $(BASE_REPO) --base_path $(BASE_PATH) --secrets_repository $(CREDENTIALS) --site_repository $(SITE_REPO) --settings_path $(SETTINGS_PATH) --master_memory_mb $(MASTER_MEMORY_MB) --ssh_key_path $(SSH_KEY_PATH) + @"$(GOBIN)/$(GONAME)" generate --installer_path $(INSTALLER_PATH) --build_path $(BUILDDIR) --base_repository $(BASE_REPO) --base_path $(BASE_PATH) --secrets_repository $(CREDENTIALS) --site_repository $(SITE_REPO) --settings_path $(SETTINGS_PATH) --master_memory_mb $(MASTER_MEMORY_MB) --ssh_key_path $(SSH_KEY_PATH) $(MAKE) workloads workloads: - @./bin/$(GONAME) workloads --site_repository $(SITE_REPO) --cluster_credentials $(CLUSTER_CREDENTIALS) --workload_type customizations - @./bin/$(GONAME) workloads --site_repository $(SITE_REPO) --cluster_credentials $(CLUSTER_CREDENTIALS) --workload_type workloads + @"$(GOBIN)$(GONAME)" workloads --site_repository $(SITE_REPO) --cluster_credentials $(CLUSTER_CREDENTIALS) --workload_type customizations + @"$(GOBIN)$(GONAME)" workloads --site_repository $(SITE_REPO) --cluster_credentials $(CLUSTER_CREDENTIALS) --workload_type workloads help: @echo "Please use \`make ' where is one of" diff --git a/bin/.gitignore b/bin/.gitignore new file mode 100644 index 0000000..72e8ffc --- /dev/null +++ b/bin/.gitignore @@ -0,0 +1 @@ +*