refactor: Add install script for coder CLI (#243)

This adds a `make install` target that copies the CLI and other coder binaries to `$GOPATH/bin` Intended to be helpful for developers who aren't familiar with `go` or the directory structure, in running `coder` CLI locally.
This commit is contained in:
Bryan
2022-02-10 20:32:00 -08:00
committed by GitHub
parent a82fb8f726
commit c0d547b6a2
2 changed files with 18 additions and 0 deletions
+8
View File
@@ -1,3 +1,5 @@
INSTALL_DIR=$(shell go env GOPATH)/bin
bin/coder:
mkdir -p bin
go build -o bin/coder cmd/coder/main.go
@@ -51,6 +53,12 @@ fmt: fmt/prettier fmt/sql
gen: database/generate peerbroker/proto provisionersdk/proto provisionerd/proto
.PHONY: gen
install:
@echo "--- Copying from bin to $(INSTALL_DIR)"
cp -r ./bin $(INSTALL_DIR)
@echo "-- CLI available at $(shell ls $(INSTALL_DIR)/coder*)"
.PHONY: install
peerbroker/proto: peerbroker/proto/peerbroker.proto
protoc \
--go_out=. \