mirror of https://github.com/coder/coder.git
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:
parent
a82fb8f726
commit
c0d547b6a2
8
Makefile
8
Makefile
|
@ -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=. \
|
||||
|
|
10
README.md
10
README.md
|
@ -15,6 +15,13 @@ This repository contains source code for Coder V2. Additional documentation:
|
|||
|
||||
## Development
|
||||
|
||||
### Pre-requisites
|
||||
|
||||
- `git`
|
||||
- `go` version 1.17, with the `GOPATH` environment variable set
|
||||
- `node`
|
||||
- `yarn`
|
||||
|
||||
### Cloning
|
||||
|
||||
- `git clone https://github.com/coder/coder`
|
||||
|
@ -23,6 +30,9 @@ This repository contains source code for Coder V2. Additional documentation:
|
|||
### Building
|
||||
|
||||
- `make build`
|
||||
- `make install`
|
||||
|
||||
The `coder` CLI binary will now be available at `$GOPATH/bin/coder`
|
||||
|
||||
### Development
|
||||
|
||||
|
|
Loading…
Reference in New Issue