添加失败通知

This commit is contained in:
孙小云 2026-01-27 17:42:27 +08:00
parent f553b46b7b
commit 65ee1cf1ba
1 changed files with 18 additions and 0 deletions

View File

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