update info
This commit is contained in:
@@ -128,13 +128,20 @@ func runScript(scriptPath, repoName, ref, commitID string) {
|
|||||||
output, err := cmd.CombinedOutput()
|
output, err := cmd.CombinedOutput()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Printf("[ERROR] 脚本执行失败 [%s]: %v\n输出:\n%s\n", scriptPath, err, string(output))
|
log.Printf("[ERROR] 脚本执行失败 [%s]: %v\n输出:\n%s\n", scriptPath, err, string(output))
|
||||||
|
title := fmt.Sprintf("%s更新失败", repoName)
|
||||||
|
body := fmt.Sprintf("分支: %s\nCommit: %s\n服务器已接收到 Push,更新失败", ref, commitID[:7])
|
||||||
|
if err := SendNotification(pushURL, globalConfig.DeviceKeys, title, body); err != nil {
|
||||||
|
log.Printf("[WARNING] 推送通知失败: %v\n", err)
|
||||||
|
} else {
|
||||||
|
log.Println("[INFO] 推送通知发送成功")
|
||||||
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
log.Printf("[SUCCESS] 脚本执行成功 [%s]\n输出:\n%s\n", scriptPath, string(output))
|
log.Printf("[SUCCESS] 脚本执行成功 [%s]\n输出:\n%s\n", scriptPath, string(output))
|
||||||
|
|
||||||
title := fmt.Sprintf("%s更新成功", repoName)
|
title := fmt.Sprintf("%s更新成功", repoName)
|
||||||
body := fmt.Sprintf("分支: %s\nCommit: %s\n服务器已接收到 Push,开始更新容器...", ref, commitID[:7])
|
body := fmt.Sprintf("分支: %s\nCommit: %s\n服务器已接收到 Push,更新成功", ref, commitID[:7])
|
||||||
if err := SendNotification(pushURL, globalConfig.DeviceKeys, title, body); err != nil {
|
if err := SendNotification(pushURL, globalConfig.DeviceKeys, title, body); err != nil {
|
||||||
log.Printf("[WARNING] 推送通知失败: %v\n", err)
|
log.Printf("[WARNING] 推送通知失败: %v\n", err)
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user