refactor control

This commit is contained in:
Ulric Qin 2020-09-26 21:58:37 +08:00
parent ae705e1b40
commit f16315328b
1 changed files with 12 additions and 42 deletions

52
control
View File

@ -15,13 +15,13 @@ usage()
start_all() start_all()
{ {
test -x n9e-rdb && start rdb test -x n9e-rdb && start rdb
test -x n9e-transfer && start transfer
test -x n9e-tsdb && start tsdb
test -x n9e-index && start index
test -x n9e-judge && start judge
test -x n9e-monapi && start monapi
test -x n9e-job && start job test -x n9e-job && start job
test -x n9e-ams && start ams test -x n9e-ams && start ams
test -x n9e-monapi && start monapi
test -x n9e-tsdb && start tsdb
test -x n9e-index && start index
test -x n9e-transfer && start transfer
test -x n9e-judge && start judge
test -x n9e-agent && start agent test -x n9e-agent && start agent
} }
@ -67,12 +67,12 @@ start()
stop_all() stop_all()
{ {
test -x n9e-monapi && stop monapi
test -x n9e-transfer && stop transfer
test -x n9e-tsdb && stop tsdb
test -x n9e-index && stop index
test -x n9e-judge && stop judge
test -x n9e-agent && stop agent test -x n9e-agent && stop agent
test -x n9e-judge && stop judge
test -x n9e-transfer && stop transfer
test -x n9e-index && stop index
test -x n9e-tsdb && stop tsdb
test -x n9e-monapi && stop monapi
test -x n9e-ams && stop ams test -x n9e-ams && stop ams
test -x n9e-job && stop job test -x n9e-job && stop job
test -x n9e-rdb && stop rdb test -x n9e-rdb && stop rdb
@ -142,12 +142,6 @@ build_one()
go build -ldflags "-X main.version=${version}" -o n9e-${mod} src/modules/${mod}/${mod}.go go build -ldflags "-X main.version=${version}" -o n9e-${mod} src/modules/${mod}/${mod}.go
} }
build_docker()
{
mod=$1
go build -ldflags "-X main.version=${version}" -o bin/n9e-${mod} src/modules/${mod}/${mod}.go
}
build() build()
{ {
export GO111MODULE=on export GO111MODULE=on
@ -166,19 +160,6 @@ build()
return return
fi fi
if [ "x${mod}" = "xdocker" ]; then
build_docker monapi
build_docker transfer
build_docker index
build_docker judge
build_docker agent
build_docker tsdb
build_docker rdb
build_docker ams
build_docker job
return
fi
build_one $mod build_one $mod
} }
@ -196,18 +177,7 @@ reload()
pack() pack()
{ {
v=$1 tar zcvf n9e-${version}.tar.gz control sql etc
if [ "x${v}" = "x" ]; then
v=$(date +%Y-%m-%d-%H-%M-%S)
fi
tar zcvf n9e-$v.tar.gz control sql pub etc/service etc/nginx.conf etc/mysql.yml etc/address.yml \
n9e-agent etc/agent.yml \
n9e-tsdb etc/tsdb.yml \
n9e-index etc/index.yml \
n9e-judge etc/judge.yml \
n9e-transfer etc/transfer.yml \
n9e-monapi etc/monapi.yml
} }
case "$1" in case "$1" in