forked from Terry-Mao/goim
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Makefile
45 lines (38 loc) · 1.32 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
# Go parameters
GOCMD=GO111MODULE=on go
GOBUILD=$(GOCMD) build
GOBUILD_LINUX=GO111MODULE=on GOOS=linux go build --mod=vendor
GOTEST=$(GOCMD) test
all: test build
build:
rm -rf target/
mkdir target/
cp cmd/comet/comet-example.toml target/comet.toml
cp cmd/logic/logic-example.toml target/logic.toml
cp cmd/job/job-example.toml target/job.toml
$(GOBUILD) -o target/comet cmd/comet/main.go
$(GOBUILD) -o target/logic cmd/logic/main.go
$(GOBUILD) -o target/job cmd/job/main.go
linux:
rm -rf target/
mkdir target/
cp cmd/comet/comet-example.toml target/comet.toml
cp cmd/logic/logic-example.toml target/logic.toml
cp cmd/job/job-example.toml target/job.toml
$(GOBUILD_LINUX) -o target/comet cmd/comet/main.go
$(GOBUILD_LINUX) -o target/logic cmd/logic/main.go
$(GOBUILD_LINUX) -o target/job cmd/job/main.go
docker:
docker build -t goim .
test:
$(GOTEST) -v ./...
clean:
rm -rf target/
run:
nohup target/logic -conf=target/logic.toml -region=sh -zone=sh001 -deploy.env=dev -weight=10 2>&1 > target/logic.log &
nohup target/comet -conf=target/comet.toml -region=sh -zone=sh001 -deploy.env=dev -weight=10 -addrs=127.0.0.1 -debug=true 2>&1 > target/comet.log &
nohup target/job -conf=target/job.toml -region=sh -zone=sh001 -deploy.env=dev 2>&1 > target/job.log &
stop:
pkill -f target/logic
pkill -f target/job
pkill -f target/comet