-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
53 lines (35 loc) · 1.77 KB
/
Makefile
File metadata and controls
53 lines (35 loc) · 1.77 KB
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
.PHONY: build run test lint clean install
BINARY := hardbox
CMD := ./cmd/hardbox
VERSION := $(shell git describe --tags --always --dirty 2>/dev/null || echo "dev")
LDFLAGS := -ldflags="-X main.version=$(VERSION)"
# ── Build ────────────────────────────────────────────────────────────────────
build:
go build $(LDFLAGS) -o bin/$(BINARY) $(CMD)
run: build
sudo ./bin/$(BINARY)
install: build
sudo install -m 0755 bin/$(BINARY) /usr/local/bin/$(BINARY)
# ── Development ──────────────────────────────────────────────────────────────
test:
go test ./... -v -race
lint:
golangci-lint run ./...
fmt:
gofmt -w .
goimports -w .
vet:
go vet ./...
# ── Audit (dry run on current machine) ───────────────────────────────────────
audit:
sudo ./bin/$(BINARY) audit --profile production --format html --output /tmp/hardbox-audit.html
dry-run:
sudo ./bin/$(BINARY) apply --profile production --dry-run
# ── Release ───────────────────────────────────────────────────────────────────
release:
goreleaser release --clean
snapshot:
goreleaser build --snapshot --clean
# ── Cleanup ──────────────────────────────────────────────────────────────────
clean:
rm -rf bin/ dist/