From 65ee1cf1badb5059606e6f29093547404a687f92 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AD=99=E5=B0=8F=E4=BA=91?= Date: Tue, 27 Jan 2026 17:42:27 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=A4=B1=E8=B4=A5=E9=80=9A?= =?UTF-8?q?=E7=9F=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .devops/monitor.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/.devops/monitor.py b/.devops/monitor.py index 05493db..052bf2f 100644 --- a/.devops/monitor.py +++ b/.devops/monitor.py @@ -369,6 +369,15 @@ class GitMonitor: target_dir = repo_path / repo_config['docker_path'] if not maven.run_maven(work_dir, commands, source_path, target_dir): + # 发送 Maven 构建失败通知 + if self.dingtalk_notifier: + duration = time.time() - start_time + self.dingtalk_notifier.send_build_failure( + repo_name=repo_name, + branch=self.global_branch, + commit_hash=commit_hash, + error_msg="Maven 打包失败" + ) return False elif repo_config['type'] == 'nodejs': @@ -379,6 +388,15 @@ class GitMonitor: target_dir = repo_path / repo_config['docker_path'] if not npm.run_npm(work_dir, commands, source_dir, target_dir): + # 发送 NPM/PNPM 构建失败通知 + if self.dingtalk_notifier: + duration = time.time() - start_time + self.dingtalk_notifier.send_build_failure( + repo_name=repo_name, + branch=self.global_branch, + commit_hash=commit_hash, + error_msg="NPM/PNPM 打包失败" + ) return False # 4. Docker 部署