-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
62 lines (43 loc) · 1.03 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
all: lint test imports build start
start:
./bin/app_name
dev: path
gowatch
fmt:
@if [ -n "$$(go fmt ./src)" ]; then \
echo "Code is not properly formatted"; \
exit 1; \
fi
pre-commit:
pre-commit run --all
imports: path
goimports -w ./src
lint: path
golangci-lint run
lint-fix: path
golangci-lint run --fix
clear:
rm -rf ./bin
## https://github.com/golang-standards/project-layout/issues/113#issuecomment-1336514449
build: clear fmt
GOARCH=amd64 go build -o ./bin/app_name ./src/main.go
build-arm: clear fmt
GOARCH=arm64 go build -o ./bin/app_name ./src/main.go
test:
go test -v ./tests
path:
export PATH=$$PATH:$$HOME/go/bin
### Kubernetes && Docker
## https://www.digitalocean.com/community/tutorials/how-to-use-minikube-for-local-kubernetes-development-and-testing
k8s-up:
minikube start
k8s-down:
minikube stop
k8s-apply:
kubectl apply -f ./infra/kubernetes
pods:
kubectl get pods -A
compose-up:
docker compose -f ./compose.yaml up -d --build
compose-down:
docker compose -f ./compose.yaml down