-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
104 lines (59 loc) · 1.49 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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
BINARY_NAME=platform-installer
MAIN_PACKAGE_PATH := ./cmd/${BINARY_NAME}
.PHONY: build
build:
GOARCH=amd64 GOOS=darwin go build -o ./bin/${BINARY_NAME}-darwin ${MAIN_PACKAGE_PATH}
GOARCH=amd64 GOOS=linux go build -o ./bin/${BINARY_NAME}-linux ${MAIN_PACKAGE_PATH}
GOARCH=amd64 GOOS=windows go build -o ./bin/${BINARY_NAME}-windows ${MAIN_PACKAGE_PATH}
.PHONY: build-linux
build-linux:
GOARCH=amd64 GOOS=linux go build -o ./bin/${BINARY_NAME}-linux ${MAIN_PACKAGE_PATH}
.PHONY: dev
dev:
go run ${MAIN_PACKAGE_PATH}
.PHONY: service-restart
service-restart:
sudo systemctl restart platform-installer
.PHONY: journal
journal:
sudo journalctl -fu platform-installer
.PHONY: run
run: build
./bin/${BINARY_NAME}
.PHONY: clean
clean:
go clean
rm ./bin/${BINARY_NAME}-darwin
rm ./bin/${BINARY_NAME}-linux
rm ./bin/${BINARY_NAME}-windows
.PHONY: pull
pull:
git pull origin main
.PHONY: test
test:
go test ./...
.PHONY: test-coverage
test-coverage:
go test ./... -coverprofile=coverage.out
.PHONY: dep
dep:
go mod download
.PHONY: vet
vet:
go vet
.PHONY: lint
lint:
golangci-lint run --enable-all
.PHONY: prod-build
prod-build: build-linux service-restart
.PHONY: prod-build-linux
prod-build-linux: build-linux service-restart
.PHONY: queue-status
queue-status:
go run ./cmd/queue-status
.PHONY: ansible-logs
ansible-logs:
tail -n -0 -f infrastructure/provisioner/logs/ansible_log.txt
.PHONY: yamllint
yamllint:
yamllint "infrastructure/provisioner/scripts/**/*.(yaml|yml)"