-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
52 lines (38 loc) · 1.41 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
CWD:=$(shell echo `pwd`)
BUILD_DIR:=$(CWD)/build
CONTENT_DIR:=$(CWD)/content_root
BUILD_OS:=$(shell go env GOOS)
BUILD_OS_ARCH:=$(shell go env GOARCH)
BUILD_OS_GOPATH:=$(shell go env GOPATH)
.PHONY: build test release
build: compile
fmt:
gofmt -s -w *.go
goimports -w *.go
go mod tidy
compile:
goreleaser --snapshot --rm-dist --skip-validate --skip-publish --parallelism 12
install: compile build
cp $(BUILD_DIR)/goath_$(BUILD_OS)_$(BUILD_OS_ARCH)/* $(BUILD_OS_GOPATH)/bin
cover: test
go tool cover -html=./coverage.out
test:
go mod vendor
go vet ./...
rm -rf ./coverage.out
go test -coverpkg=./... -coverprofile=./coverage.out ./...
release: fmt test compile
update-all: update-server update-assets update-creds
install-units:
scp $(CWD)/units/* [email protected]:/etc/systemd/system/
install-nats:
scp $(CWD)/nats-server-v2.1.4-linux-amd64/nats-server [email protected]:/usr/local/bin
update-server: compile
scp $(BUILD_DIR)/authdemo_linux_amd64/* [email protected]:/usr/local/bin
scp $(BUILD_DIR)/pokeroom_linux_amd64/* [email protected]:/usr/local/bin
update-assets:
scp -r $(CONTENT_DIR)/* [email protected]:/srv/content_root
scp $(CWD)/server.conf [email protected]:/srv/
scp $(CWD)/gcreds.json [email protected]:/srv/
update-creds:
scp ~/.nkeys/creds/authdemo/authdemo/admin.creds [email protected]:/srv/admin.creds