forked from tty47/torch
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
72 lines (55 loc) · 1.86 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
PROJECT_NAME := $(shell basename `pwd`)
REPOSITORY_NAME := $(shell basename `pwd`)
REGISTRY_NAME=ghcr.io/celestiaorg
LOCAL_DEV=local
# Go
.PHYONY: run build test test_cover get docs clean_bin
run:
go run ./cmd/main.go
run-config:
go run ./cmd/main.go --config-file=./config-test.yaml
build:
go build -o ./bin/${PROJECT_NAME} ./cmd/main.go
test:
go test ./... -v .
test_cover:
go test ./... -v -coverprofile cover.out
go tool cover -func ./cover.out | grep total | awk '{print $3}'
get:
go get ./...
docs:
godoc -http=:6060
clean_bin:
rm ./${PROJECT_NAME} || true
# Docker
docker_build:
docker build -f Dockerfile -t ${PROJECT_NAME} -t ${PROJECT_NAME}:latest .
.PHYONY: docker_build
docker_build_local_push:
docker build -f Dockerfile -t ${PROJECT_NAME} .
docker tag ${PROJECT_NAME}:latest localhost:5000/${REPOSITORY_NAME}:latest
docker push localhost:5000/${REPOSITORY_NAME}:latest
.PHYONY: docker_build_local_push
docker_build_local_push_gh: clean_bin
GOOS=linux GOARCH=amd64 go build -o ./${PROJECT_NAME} ./cmd/main.go &&\
docker build -f Dockerfile_local -t ${REGISTRY_NAME}/${PROJECT_NAME}:latest .
docker push ${REGISTRY_NAME}/${PROJECT_NAME}:latest
.PHYONY: docker_build_local_push_gh
docker_run:
docker run -p 8080:8080 ${PROJECT_NAME}:latest
.PHYONY: docker_run
kubectl_apply:
kubectl delete -f ./deployment/deployment.yaml ;\
kubectl apply -f ./deployment/deployment.yaml
.PHYONY: kubectl_apply
kubectl_kustomize:
kubectl delete -k ./deployment/overlays/${LOCAL_DEV} ;\
kubectl apply -k ./deployment/overlays/${LOCAL_DEV}
.PHYONY: kubectl_kustomize
kubectl_kustomize_delete:
kubectl delete -k ./deployment/overlays/${LOCAL_DEV}
.PHYONY: kubectl_kustomize_delete
kubectl_deploy: docker_build_local_push kubectl_apply
.PHYONY: kubectl_deploy
kubectl_remote_kustomize_deploy: docker_build_local_push_gh kubectl_kustomize
.PHYONY: kubectl_remote_kustomize_deploy