1
0
mirror of https://shylinux.com/x/icebergs synced 2025-04-26 01:24:05 +08:00
This commit is contained in:
harveyshao 2022-04-23 09:36:38 +08:00
parent fc85438a01
commit 66d48572a0
3 changed files with 24 additions and 26 deletions

31
conf.go
View File

@ -124,21 +124,22 @@ const ( // DIR
USR_LOCAL_DAEMON = "usr/local/daemon"
USR_LOCAL_EXPORT = "usr/local/export"
VAR_RUN = "var/run"
VAR_TMP = "var/tmp"
VAR_LOG = "var/log"
VAR_CONF = "var/conf"
VAR_DATA = "var/data"
VAR_FILE = "var/file"
VAR_PROXY = "var/proxy"
VAR_TRASH = "var/trash"
BIN_ICE_SH = "bin/ice.sh"
BIN_ICE_BIN = "bin/ice.bin"
BIN_BOOT_LOG = "bin/boot.log"
ETC_INIT_SHY = "etc/init.shy"
ETC_EXIT_SHY = "etc/exit.shy"
ETC_MISS_SH = "etc/miss.sh"
ETC_PATH = "etc/path"
VAR_RUN = "var/run"
VAR_TMP = "var/tmp"
VAR_LOG = "var/log"
VAR_CONF = "var/conf"
VAR_DATA = "var/data"
VAR_FILE = "var/file"
VAR_PROXY = "var/proxy"
VAR_TRASH = "var/trash"
BIN_ICE_SH = "bin/ice.sh"
BIN_ICE_BIN = "bin/ice.bin"
BIN_BOOT_LOG = "bin/boot.log"
ETC_INIT_SHY = "etc/init.shy"
ETC_LOCAL_SHY = "etc/local.shy"
ETC_EXIT_SHY = "etc/exit.shy"
ETC_MISS_SH = "etc/miss.sh"
ETC_PATH = "etc/path"
SRC_HELP = "src/help"
SRC_DEBUG = "src/debug"

View File

@ -125,17 +125,10 @@ func init() {
_header_users(m, m.ActionKey(), arg...)
}},
"config": {Name: "config", Help: "配置", Hand: func(m *ice.Message, arg ...string) {
ctx.CONFIG: {Name: "config", Help: "配置", Hand: func(m *ice.Message, arg ...string) {
pod := strings.Split(m.Cmdx(web.SPACE, m.Option(ice.MSG_USERPOD), cli.RUNTIME, "make.domain"), "/chat/pod/")[1]
m.Cmd(web.SPACE, m.Option(ice.MSG_USERPOD), nfs.SAVE, "etc/local.shy", m.Cmdx(web.SPACE, pod, nfs.CAT, "etc/local.shy"))
m.Cmd(web.SPACE, m.Option(ice.MSG_USERPOD), ssh.SOURCE, "etc/local.shy")
}},
"source": {Name: "source", Help: "源码", Hand: func(m *ice.Message, arg ...string) {
m.Cmd(web.SPACE, m.Option(ice.MSG_USERPOD), cli.SYSTEM, "git", "push", "-u", m.MergeURL2("/x/")+m.Option(ice.MSG_USERPOD))
}},
aaa.INVITE: {Name: "invite", Help: "脚本", Hand: func(m *ice.Message, arg ...string) {
m.Cmdy(code.PUBLISH, ice.CONTEXTS, ice.CORE, ice.MISC)
m.Cmd(code.PUBLISH, mdb.CREATE, nfs.FILE, ice.BIN_ICE_BIN)
m.Cmd(web.SPACE, m.Option(ice.MSG_USERPOD), nfs.SAVE, ice.ETC_LOCAL_SHY, m.Cmdx(web.SPACE, pod, nfs.CAT, ice.ETC_LOCAL_SHY))
m.Cmd(web.SPACE, m.Option(ice.MSG_USERPOD), ssh.SOURCE, ice.ETC_LOCAL_SHY)
}},
code.WEBPACK: {Name: "webpack", Help: "打包页面", Hand: func(m *ice.Message, arg ...string) {
m.Cmdy(code.WEBPACK, cli.BUILD, m.OptionSimple(mdb.NAME))

View File

@ -276,6 +276,10 @@ func init() {
"branch_switch": {Name: "branch_switch", Help: "切换", Hand: func(m *ice.Message, arg ...string) {
_repos_cmd(m.Spawn(), m.Option(REPOS), "checkout", m.Option(BRANCH))
}},
"release": {Name: "release", Help: "发布", Hand: func(m *ice.Message, arg ...string) {
m.Cmdy(cli.SYSTEM, "git", "push", "-u", m.MergeURL2("/x/")+m.Option(ice.MSG_USERPOD))
m.Cmdy(code.PUBLISH, ice.CONTEXTS, ice.MISC, ice.CORE)
}},
BRANCH: {Name: "branch", Help: "分支", Hand: func(m *ice.Message, arg ...string) {
for _, line := range kit.Split(_repos_cmd(m.Spawn(), arg[0], BRANCH).Result(), ice.NL, ice.NL) {
if strings.HasPrefix(line, "*") {
@ -303,7 +307,7 @@ func init() {
}},
}, Hand: func(m *ice.Message, c *ice.Context, cmd string, arg ...string) {
if len(arg) == 0 {
m.Action(PULL, MAKE, PUSH, TAGS, STASH, PIE)
m.Action(PULL, MAKE, PUSH, TAGS, STASH, PIE, "release")
files, adds, dels, last := _status_list(m)
m.Status("files", files, "adds", adds, "dels", dels, "last", last.Format(ice.MOD_TIME))