-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmakefile
146 lines (111 loc) · 3.16 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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
# Vars
STG_TAG=stage
PROD_TAG=v0.0.1
IMAGE_NAME=boletus
# Misc
BINARY_NAME=boletus
BINARY_UNIX=$(BINARY_NAME)_unix
all: test build
build:
go build -o ./bin/$(BINARY_NAME) ./cmd/$(BINARY_NAME).go
build-linux:
CGOENABLED=0 GOOS=linux GOARCH=amd64; go build -o ./bin/$(BINARY_UNIX) ./cmd/$(BINARY_NAME).go
test:
make -f makefile.test test-selected
grc-test:
grc make -f makefile.test test-selected
clean:
go clean
rm -f ./bin/$(BINARY_NAME)
rm -f ./bin/$(BINARY_UNIX)
run:
./scripts/run.sh
package-resources:
pkger -include /assets/web/embed -o pkg/web
list-package-resources:
pkger list -include /assets/web --json
# Cloud
connect-stg:
gcloud beta container clusters get-credentials ${GC_STG_CLUSTER} --region ${GC_REGION} --project ${GC_STG_PROJECT}
connect-prod:
gcloud beta container clusters get-credentials ${GC_PROD_CLUSTER} --region ${GC_REGION} --project ${GC_PROD_PROJECT}
build-stg:
make build
docker login
docker build -t ${DOCKER_ACCOUNT}/$(IMAGE_NAME):$(STG_TAG) .
docker push ${DOCKER_ACCOUNT}/$(IMAGE_NAME):$(STG_TAG)
build-prod:
make build
docker login
docker build -t ${DOCKER_ACCOUNT}/$(IMAGE_NAME):$(PROD_TAG) .
docker push ${DOCKER_ACCOUNT}/$(IMAGE_NAME):$(PROD_TAG)
template-stg:
helm template --name $(IMAGE_NAME) -f ./deployments/helm/values-stg.yaml ./deployments/helm
template-prod:
helm template --name $(IMAGE_NAME) -f ./deployments/helm/values-prod.yaml ./deployments/helm
install-stg:
make connect-stg
helm install --name $(IMAGE_NAME) -f ./deployments/helm/values-stg.yaml ./deployments/helm
install-prod:
make connect-prod
helm install --name $(IMAGE_NAME) -f ./deployments/helm/values-prod.yaml ./deployments/helm
delete-stg:
make connect-stg
helm del --purge $(IMAGE_NAME)
delete-prod:
make connect-prod
helm del --purge $(IMAGE_NAME)
deploy-stg:
make build-stg
make connect-stg
make delete-stg
make install-stg
deploy-prod:
make build-prod
make connect-prod
make delete-prod
make install-prod
## Misc
gen-proto:
sh third_party/protoc-gen.sh
custom-build:
make mod tidy; go mod vendor; go build ./...
clean-and-run:
clear
make package-resources
make run
current-conn:
kubectl config current-context
grc-install:
sudo apt-get install grc
make grc-configure
spacer:
@echo "\n"
build-client:
go build -o ./bin/client ./cmd/client/client.go
client:
./scripts/cltent.sh
enable-grpc-logging:
export GRPC_GO_LOG_VERBOSITY_LEVEL=99
export GRPC_GO_LOG_SEVERITY_LEVEL=info
disable-grpc-logging:
export GRPC_GO_LOG_VERBOSITY_LEVEL=0
export GRPC_GO_LOG_SEVERITY_LEVEL=error
get-deps:
go get -u "github.com/aws/aws-sdk-go"
go get -u "github.com/go-chi/chi"
go get -u "github.com/gorilla/csrf"
go get -u "github.com/gorilla/schema"
go get -u "github.com/gorilla/sessions"
go get -u "github.com/jmoiron/sqlx"
go get -u "github.com/lib/pq"
go get -u "github.com/markbates/pkger"
go get -u "github.com/myesui/uuid"
go get -u "github.com/nicksnyder/go-i18n/v2"
go get -u "github.com/rs/zerolog"
go get -u "github.com/satori/go.uuid"
go get -u "golang.org/x/crypto"
go get -u "golang.org/x/text"
go get -u "google.golang.org/appengine"
go get -u "gopkg.in/DATA-DOG/go-sqlmock.v1"
go get -u "gopkg.in/stretchr/testify.v1"