-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
31 lines (24 loc) · 1.04 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
APP=mccs
GIT_TAG = $(shell if [ "`git describe --tags --abbrev=0 2>/dev/null`" != "" ];then git describe --tags --abbrev=0; else git log --pretty=format:'%h' -n 1; fi)
BUILD_DATE = $(shell TZ=UTC date +%FT%T%z)
GIT_COMMIT = $(shell git log --pretty=format:'%H' -n 1)
GIT_TREE_STATUS = $(shell if git status|grep -q 'clean';then echo clean; else echo dirty; fi)
production:
@echo "=============starting production server============="
GIT_TAG=${GIT_TAG} BUILD_DATE=${BUILD_DATE} GIT_COMMIT=${GIT_COMMIT} GIT_TREE_STATUS=${GIT_TREE_STATUS} \
docker-compose -f docker-compose.production.yml up --build
clean:
@echo "=============removing app============="
rm -f ${APP}
run:
@echo "=============starting server============="
docker-compose -f docker-compose.dev.yml up --build
test:
@echo "=============running test============="
go test ./...
seed:
@echo "=============generating seed data============="
go run cmd/seed/main.go -config="seed"
es-restore:
@echo "=============restoring es data============="
go run cmd/es-restore/main.go -config="seed"