This commit is contained in:
xiaojunnuo
2024-09-06 00:13:21 +08:00
parent af388ec39f
commit 3bad0b2685
13 changed files with 292 additions and 240 deletions
+3 -5
View File
@@ -96,14 +96,13 @@ export class Executor {
runnable.runnableType = runnableType;
this.runtime.start(runnable);
await this.onChanged(this.runtime);
const lastNode = this.lastStatusMap.get(runnable.id);
const lastResult = lastNode?.status?.status;
if (runnable.strategy?.runStrategy === RunStrategy.SkipWhenSucceed) {
//如果是成功后跳过策略
const lastNode = this.lastStatusMap.get(runnable.id);
const lastResult = lastNode?.status?.status;
const lastInput = JSON.stringify(lastNode?.status?.input);
let inputChanged = false;
if (runnableType === "step") {
const lastInput = JSON.stringify((lastNode as Step)?.input);
const step = runnable as Step;
const input = JSON.stringify(step.input);
if (input != null && lastInput !== input) {
@@ -271,7 +270,6 @@ export class Executor {
// this.runtime.context[stepOutputKey] = instance[key];
});
step.status!.files = instance.getFiles();
//更新pipeline vars
if (Object.keys(instance._result.pipelineVars).length > 0) {
// 判断 pipelineVars 有值时更新
@@ -41,10 +41,8 @@ export class RunHistory {
this._loggers[runnable.id] = buildLogger((text) => {
this.logs[runnable.id].push(text);
});
const input = (runnable as Step).input;
const status: HistoryResult = {
output: {},
input: _.cloneDeep(input),
status: ResultType.start,
startTime: now,
result: ResultType.start,
+1 -1
View File
@@ -118,7 +118,7 @@ export type HistoryResultGroup = {
};
};
export type HistoryResult = {
input: any;
// input: any;
output: any;
files?: FileItem[];
/**
+2 -2
View File
@@ -66,8 +66,8 @@ async function spawn(opts: SpawnOption): Promise<string> {
cmd = item;
}
}
}else{
cmd = opts.cmd
} else {
cmd = opts.cmd;
}
log.info(`执行命令: ${cmd}`);
let stdout = "";