-
-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathMakefile
66 lines (54 loc) · 1.54 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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
VERSION = $(shell git describe --tags --dirty --always)
GIT_COMMIT = $(shell git rev-parse HEAD)
RANDOM_SUFFIX := $(shell cat /dev/urandom | tr -dc 'a-z0-9' | head -c5)
PROJECT = github.com/leg100/pug
LD_FLAGS = " \
-s -w \
-X '$(PROJECT)/internal.Version=$(VERSION)' \
-X '$(PROJECT)/internal.Commit=$(GIT_COMMIT)' \
-X '$(PROJECT)/internal.Built=$(shell date +%s)' \
" \
.PHONY: build
build:
CGO_ENABLED=0 go build -o _build/ -ldflags $(LD_FLAGS) ./...
chmod -R +x _build/*
.PHONY: install
install:
go install -ldflags $(LD_FLAGS) ./...
.PHONY: test
test:
go test ./...
.PHONY: lint
lint:
staticcheck ./...
.PHONY: fmt
fmt:
go fmt ./...
.PHONY: vet
vet:
go vet ./...
.PHONY: install-linter
install-linter:
go install honnef.co/go/tools/cmd/staticcheck@latest
.PHONY: debug
debug:
dlv debug --headless --api-version=2 --listen=127.0.0.1:4300 . -- -w ./demo/dont_cost_money -d
# Exiting delve neglects to restore the terminal, so we do so here.
reset
.PHONY: connect
connect:
dlv connect 127.0.0.1:4300 .
.PHONY: install-terragrunt
install-terragrunt:
mkdir -p ~/.local/bin
curl -L https://github.com/gruntwork-io/terragrunt/releases/download/v0.67.0/terragrunt_linux_amd64 -o ~/.local/bin/terragrunt
chmod +x ~/.local/bin/terragrunt
.PHONY: install-infracost
install-infracost:
mkdir -p ~/.local/bin
curl -L https://github.com/infracost/infracost/releases/download/v0.10.38/infracost-linux-amd64.tar.gz | tar -zxf -
mv infracost-linux-amd64 ~/.local/bin/infracost
chmod +x ~/.local/bin/infracost
.PHONY: demo
demo:
vhs demo/vhs.tape