添加失败通知
This commit is contained in:
parent
f553b46b7b
commit
65ee1cf1ba
|
|
@ -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 部署
|
||||
|
|
|
|||
Loading…
Reference in New Issue