10 changed files with 90 additions and 33 deletions
@ -0,0 +1,39 @@ |
|||
package main |
|||
|
|||
import ( |
|||
"fmt" |
|||
"github.com/yedf/dtm/common" |
|||
"github.com/yedf/dtm/dtmcli" |
|||
"github.com/yedf/dtm/dtmcli/dtmimp" |
|||
"github.com/yedf/dtm/dtmsvr" |
|||
"github.com/yedf/dtm/examples" |
|||
"os" |
|||
) |
|||
|
|||
var hint = `To start the bench server, you need to specify the parameters: |
|||
|
|||
Available commands: |
|||
http start bench server |
|||
` |
|||
|
|||
func main() { |
|||
if len(os.Args) <= 1 { |
|||
fmt.Printf(hint) |
|||
return |
|||
} |
|||
dtmimp.Logf("starting dtm....") |
|||
if os.Args[1] == "http" { |
|||
fmt.Println("start bench server") |
|||
common.MustLoadConfig() |
|||
dtmcli.SetCurrentDBType(common.DtmConfig.DB["driver"]) |
|||
common.WaitDBUp() |
|||
dtmsvr.PopulateDB(true) |
|||
examples.PopulateDB(true) |
|||
dtmsvr.StartSvr() // 启动dtmsvr的api服务
|
|||
go dtmsvr.CronExpiredTrans(-1) // 启动dtmsvr的定时过期查询
|
|||
StartSvr() |
|||
select {} |
|||
} else { |
|||
fmt.Printf(hint) |
|||
} |
|||
} |
|||
@ -1,8 +0,0 @@ |
|||
set -x |
|||
if [ x$1 == x ]; then |
|||
echo please specify version |
|||
exit 1 |
|||
fi |
|||
|
|||
docker build -f helper/Dockerfile-release -t yedf/dtm:latest . && docker push yedf/dtm:latest |
|||
docker tag yedf/dtm:latest yedf/dtm:$1 && docker push yedf/dtm:$1 |
|||
Loading…
Reference in new issue