1
0
镜像自地址 https://github.com/tuna/tunasync.git 已同步 2025-12-06 06:26:46 +00:00

feature(worker): added exec_on_success and exec_on_failure option and hooks

这个提交包含在:
bigeagle
2016-04-29 21:47:42 +08:00
父节点 a644294bd7
当前提交 bd423eec4e
共有 5 个文件被更改,包括 238 次插入0 次删除

查看文件

@@ -34,6 +34,7 @@ provider = "command"
upstream = "https://aosp.google.com/"
interval = 720
mirror_dir = "/data/git/AOSP"
exec_on_success = "bash -c 'echo ${TUNASYNC_JOB_EXIT_STATUS} > ${TUNASYNC_WORKING_DIR}/exit_status'"
[mirrors.env]
REPO = "/usr/local/bin/aosp-repo"
@@ -51,6 +52,7 @@ provider = "rsync"
upstream = "rsync://ftp.fedoraproject.org/fedora/"
use_ipv6 = true
exclude_file = "/etc/tunasync.d/fedora-exclude.txt"
exec_on_failure = "bash -c 'echo ${TUNASYNC_JOB_EXIT_STATUS} > ${TUNASYNC_WORKING_DIR}/exit_status'"
`
Convey("When giving invalid file", t, func() {
@@ -123,6 +125,12 @@ exclude_file = "/etc/tunasync.d/fedora-exclude.txt"
So(p.LogFile(), ShouldEqual, "/var/log/tunasync/AOSP/latest.log")
_, ok := p.(*cmdProvider)
So(ok, ShouldBeTrue)
for _, hook := range p.Hooks() {
switch h := hook.(type) {
case *execPostHook:
So(h.command, ShouldResemble, []string{"bash", "-c", `echo ${TUNASYNC_JOB_EXIT_STATUS} > ${TUNASYNC_WORKING_DIR}/exit_status`})
}
}
p = w.providers["debian"]
So(p.Name(), ShouldEqual, "debian")