-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathMakefile
42 lines (29 loc) · 965 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
37
38
39
40
41
42
.PHONY: clean build unit-test run docker-* tag release
NAME=trading-gpt
VERSION=0.28.4
clean:
rm -rf build/*
build: clean
CGO_ENABLED=0 go build -o ./build/bbgo ./main.go
build-linux:
CGO_ENABLED=0 GOOS=linux go build -o ./build/bbgo ./main.go
unit-test:
go test ./pkg/...
run: build
./build/bbgo run --dotenv .env.local --config bbgo.yaml --lightweight false --no-sync false
docker-build: build-linux
docker build --tag yubing744/${NAME}:${VERSION} .
docker tag yubing744/${NAME}:${VERSION} yubing744/${NAME}:latest
docker-push:
docker push yubing744/${NAME}:${VERSION}
docker push yubing744/${NAME}:latest
docker-start:
docker run --name ${NAME} --net host -d -v ${PWD}:/strategy yubing744/${NAME}:${VERSION} run --dotenv .env.local --config bbgo.yaml
docker-stop:
docker rm -f ${NAME}
docker-logs:
docker logs -f --tail 100 ${NAME}
tag:
git tag -m "release v${VERSION}" v${VERSION}
git push --tags
release: docker-build tag docker-push