1
0
forked from x/icebergs
This commit is contained in:
IT 老营长 @云轩领航-创始人 2022-02-14 12:17:31 +08:00
parent cd2c102369
commit c42444ccf5
3 changed files with 10 additions and 1 deletions

View File

@ -88,7 +88,7 @@ func _dream_show(m *ice.Message, name string) {
m.Optionv(cli.CMD_OUTPUT, path.Join(p, m.Config(kit.Keys(cli.ENV, cli.CTX_LOG))))
// 启动任务
m.Cmd(cli.DAEMON, "ice.bin", SPACE, tcp.DIAL, ice.DEV, ice.OPS, mdb.NAME, name, m.OptionSimple(RIVER))
m.Cmd(cli.DAEMON, kit.Path(os.Args[0]), SPACE, tcp.DIAL, ice.DEV, ice.OPS, mdb.NAME, name, m.OptionSimple(RIVER))
defer m.Event(DREAM_CREATE, kit.SimpleKV("", m.Option(mdb.TYPE), name)...)
m.Sleep3s()
}

View File

@ -72,6 +72,8 @@ func init() {
m.Log_EXPORT(nfs.SOURCE, main, nfs.TARGET, file)
m.Cmdy(nfs.DIR, file, "time,path,size,link,action")
name := path.Base(m.Append(nfs.PATH))
m.EchoScript(kit.Format("# 下载启动\nwget %s && chmod u+x %s\n./%s forever serve dev %s\ntail -f var/log/bench.log",
m.MergeURL2(kit.Format("/publish/%s", name)), name, name, m.MergeURL2(ice.PS)))
m.EchoScript(kit.Format("# 下载启动\ncurl -fOL %s && chmod u+x %s\n./%s forever serve dev %s\ntail -f var/log/bench.log",
m.MergeURL2(kit.Format("/publish/%s", name)), name, name, m.MergeURL2(ice.PS)))
m.Cmd(PUBLISH, mdb.CREATE, ice.BIN_ICE_SH)

View File

@ -184,8 +184,15 @@ func init() {
switch {
case strings.Contains(osid, cli.ALPINE):
m.Cmd(cli.SYSTEM, "apk", "add", "git", "go")
m.Cmd(cli.SYSTEM, "go", "get", "shylinux.com/x/ice")
case strings.Contains(osid, cli.CENTOS):
m.Cmdy(INSTALL, web.DOWNLOAD, "https://golang.google.cn/dl/go1.15.5.linux-amd64.tar.gz", ice.USR_LOCAL)
case strings.Contains(osid, cli.UBUNTU):
m.Cmdy(INSTALL, web.DOWNLOAD, "https://golang.google.cn/dl/go1.15.5.linux-amd64.tar.gz", ice.USR_LOCAL)
default:
m.Toast("please install git and go")
return
}
m.ToastSuccess()
}},