-
Notifications
You must be signed in to change notification settings - Fork 7
/
Makefile
38 lines (28 loc) · 1.14 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
.PHONY: run-backend run-worker run-frontend syncdb release
MAKEFLAGS += --warn-undefined-variables
# Build variables
REGISTRY_URI :=www.haozheyu.top
RELEASE_VERSION :=$(shell git describe --always --tags)
UI_BUILD_VERSION :=v1.0.0
SERVER_BUILD_VERSION :=v1.0.0
# run module
run-backend:
cd src/backend/ && go run main.go
# dev
syncdb:
go run src/backend/database/syncdb.go orm syncdb
sqlall:
go run src/backend/database/syncdb.go orm sqlall > _dev/kube_web.sql
initdata:
go run src/backend/database/generatedata/main.go > _dev/kube_web-data.sql
swagger-openapi:
cd src/backend && swagger generate spec -o ./swagger/openapi.swagger.json
# release, requiring Docker 17.05 or higher on the daemon and client
build-backend-image:
@echo "version: $(RELEASE_VERSION)"
docker build --no-cache -t $(REGISTRY_URI)/kube-web-backend:$(RELEASE_VERSION) .
push-image:
docker tag $(REGISTRY_URI)/kube-web-backend:$(RELEASE_VERSION) $(REGISTRY_URI)/kube-web-backend:latest
docker push $(REGISTRY_URI)/kube-web-backend:$(RELEASE_VERSION)
docker push $(REGISTRY_URI)/kube-web-backend:latest
release: build-backend-image push-image