镜像自地址
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
这个提交包含在:
@@ -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")
|
||||
|
||||
在新工单中引用
屏蔽一个用户