-
Notifications
You must be signed in to change notification settings - Fork 35
/
Makefile
36 lines (29 loc) · 1011 Bytes
/
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
test: fmt
go test -race ./controller/test/...
go test -race ./service/checker/...
go test -race ./service/sql_util/...
go test -race ./util/...
build: fmt
mkdir -p bin
go build -o bin/owl ./cmd/owl/
build-linux: fmt
CGO_ENABLED=0 GOOS=linux go build -o bin/owl -a -ldflags '-extldflags "-static"' ./cmd/owl/
fmt:
go fmt ./...
run: build-front build
./bin/owl
.ONESHELL:
build-front:
if [ ! -e "./static" ]; then \
rm -rf ./static && \
wget https://github.com/ibanyu/owl_web/releases/download/v1.0/static.tar && tar -xvf static.tar; \
fi
#
# mkdir -p bin/front
# if [ ! -e "./bin/front/owl_web" ]; then cd bin/front && git clone https://github.com/qingfeng777/owl_web.git; else cd bin/front/owl_web && git pull; fi
# cd bin/front/owl_web && yarn install && yarn build
# rm -rf ./static && mkdir static && mv bin/front/owl_web/dist/* ./static/
build-docker: build-front build
docker build -t palfish/owl:v0.1.0 .
run-docker: build-docker
docker run -p 8081:8081 -d palfish/owl:v0.1.0