From dd595a3a89f75c833467a215912d1a8a46ee7f1c Mon Sep 17 00:00:00 2001 From: shaoying Date: Fri, 11 Sep 2020 01:03:11 +0800 Subject: [PATCH] opt some --- base/web/dream.go | 2 +- core/code/code.go | 1 + core/code/install.go | 16 ++++++++++------ 3 files changed, 12 insertions(+), 7 deletions(-) diff --git a/base/web/dream.go b/base/web/dream.go index 69218219..97777574 100644 --- a/base/web/dream.go +++ b/base/web/dream.go @@ -98,7 +98,7 @@ require miss.sh }, Commands: map[string]*ice.Command{ DREAM: {Name: "dream [name [cmd...]] auto", Help: "梦想家", Meta: kit.Dict("detail", []interface{}{"启动", "停止"}), Action: map[string]*ice.Action{ - gdb.START: {Name: "start", Help: "启动", Hand: func(m *ice.Message, arg ...string) { + gdb.START: {Name: "start type name", Help: "启动", Hand: func(m *ice.Message, arg ...string) { _dream_show(m, m.Option(kit.MDB_NAME)) }}, gdb.STOP: {Name: "stop", Help: "停止", Hand: func(m *ice.Message, arg ...string) { diff --git a/core/code/code.go b/core/code/code.go index 238744eb..ed2a9b1a 100644 --- a/core/code/code.go +++ b/core/code/code.go @@ -50,6 +50,7 @@ var Index = &ice.Context{Name: "code", Help: "编程中心", ice.CTX_INIT: {Hand: func(m *ice.Message, c *ice.Context, cmd string, arg ...string) { m.Load() m.Cmd(mdb.ENGINE, mdb.CREATE, BENCH) + m.Conf(INSTALL, "meta.contexts", _contexts) }}, ice.CTX_EXIT: {Hand: func(m *ice.Message, c *ice.Context, cmd string, arg ...string) { m.Save(INSTALL) diff --git a/core/code/install.go b/core/code/install.go index 7d4ba111..d5a9329f 100644 --- a/core/code/install.go +++ b/core/code/install.go @@ -16,15 +16,19 @@ import ( ) var _contexts = kit.Dict( - "tmux", `yum install -y tmux -curl -o tmux.conf {{.Option "httphost"}}/publish/tmux.conf -tmux -f tmux.conf`, - "base", `mkdir contexts; cd contexts + "tmux", ` +# 终端环境 +curl -fLo /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-8.repo && yum -y update +yum install -y tmux vim +`, + "base", ` +# 生产环境 +mkdir contexts; cd contexts export ctx_dev={{.Option "httphost"}} ctx_log=/dev/stdout; curl $ctx_dev/publish/ice.sh |sh -export ctx_dev={{.Option "httphost"}} ctx_log=/dev/stdout; wget -O - $ctx_dev/publish/ice.sh | sh bin/ice.sh`, "miss", ` -yum install -y git vim make go +# 开发环境 +yum install -y make git go mkdir ~/.ssh &>/dev/null; touch ~/.ssh/config; [ -z "$(cat ~/.ssh/config|grep 'HOST {{.Option "hostname"}}')" ] && echo -e "HOST {{.Option "hostname"}}\n Port 9030" >> ~/.ssh/config export ISH_CONF_HUB_PROXY={{.Option "userhost"}}:.ish/pluged/ git clone $ISH_CONF_HUB_PROXY/github.com/shylinux/contexts && cd contexts