mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
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:
@@ -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=. \
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user