|
@@ -106,8 +106,7 @@ public class BuildService {
|
|
|
deployApp.deploy(buildId);
|
|
deployApp.deploy(buildId);
|
|
|
ctx.log(">>> [Step 6] 部署请求已提交。");
|
|
ctx.log(">>> [Step 6] 部署请求已提交。");
|
|
|
} else {
|
|
} else {
|
|
|
- AppBuilding appBuilding = buildLogService.getAppBuilding(appId);
|
|
|
|
|
- buildDeployNotify.buildNotify(appBuilding);
|
|
|
|
|
|
|
+ sendNotify(appId);
|
|
|
}
|
|
}
|
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
|
// 核心设计:一旦任何一步抛出异常,立即进入这里
|
|
// 核心设计:一旦任何一步抛出异常,立即进入这里
|
|
@@ -116,6 +115,7 @@ public class BuildService {
|
|
|
ctx.log("!!! [Pipeline] 任务失败,原因: " + errorMsg + System.lineSeparator() + stackTrace);
|
|
ctx.log("!!! [Pipeline] 任务失败,原因: " + errorMsg + System.lineSeparator() + stackTrace);
|
|
|
// 这里更新数据库状态为 FAILURE
|
|
// 这里更新数据库状态为 FAILURE
|
|
|
buildLogService.updateMainStatus(ctx, StepStatus.FAILURE.name());
|
|
buildLogService.updateMainStatus(ctx, StepStatus.FAILURE.name());
|
|
|
|
|
+ sendNotify(appId);
|
|
|
}
|
|
}
|
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
|
throw new RuntimeException(e);
|
|
throw new RuntimeException(e);
|
|
@@ -123,6 +123,11 @@ public class BuildService {
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ private void sendNotify(String appId) {
|
|
|
|
|
+ AppBuilding appBuilding = buildLogService.getAppBuilding(appId);
|
|
|
|
|
+ buildDeployNotify.buildNotify(appBuilding);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
private void runStep(PipelineContext ctx, String stepName, StepExecutor executor) {
|
|
private void runStep(PipelineContext ctx, String stepName, StepExecutor executor) {
|
|
|
try {
|
|
try {
|
|
|
ctx.updateStep(stepName, StepStatus.RUNNING.name(), null);
|
|
ctx.updateStep(stepName, StepStatus.RUNNING.name(), null);
|