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 部署