forked from Qihoo360/wayne
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
53 lines (35 loc) · 1.31 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
.PHONY: run-backend run-worker run-frontend syncdb release
MAKEFLAGS += --warn-undefined-variables
# Runtime/Dev variables (used in src/backend/conf/app.conf)
-include .env
export
# Build variables
RELEASE_VERSION :=$(shell git describe --always --tags)
UI_BUILD_VERSION :=v1.0.0
SERVER_BUILD_VERSION :=v1.0.0
release: build-release-image push-image
# 运行相关
run-backend:
cd src/backend/ && bee run -main=./main.go -runargs="apiserver"
run-worker:
cd src/backend/ && bee run -main=./main.go -runargs="worker -t AuditWorker -c 2"
run-frontend:
cd src/frontend/ && npm start
# 开发相关
syncdb:
go run src/backend/database/syncdb.go orm syncdb
swagger-openapi:
cd src/backend && swagger generate spec -o openapi.swagger.json
# 构建相关, 需要Docker版本17.05或者更高
build-release-image:
@echo "version: $(RELEASE_VERSION)"
docker build --no-cache --build-arg RAVEN_DSN=$(RAVEN_DSN) -t 360cloud/wayne:$(RELEASE_VERSION) .
push-image:
docker push 360cloud/wayne:$(RELEASE_VERSION)
## 构建后端代码的编译环境
build-server-image:
cd hack/build/server && docker build --no-cache \
-t 360cloud/wayne-server-builder:$(SERVER_BUILD_VERSION) .
## 构建前端代码的编译环境
build-ui-image:
docker build -f hack/build/ui/Dockerfile -t 360cloud/wayne-ui-builder:$(UI_BUILD_VERSION) .