fix
parent
6c47dd912a
commit
67bf2d2afd
|
@ -4747,7 +4747,7 @@ class CloudRunnerCustomHooks {
|
||||||
throw error;
|
throw error;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return output.filter((x) => x.step !== undefined && x.hook !== undefined && x.hook.length > 0);
|
return output.filter((x) => x.hook !== undefined && x.hook.length > 0);
|
||||||
}
|
}
|
||||||
static GetCustomHooksFromFiles(hookLifecycle) {
|
static GetCustomHooksFromFiles(hookLifecycle) {
|
||||||
const results = [];
|
const results = [];
|
||||||
|
@ -4785,15 +4785,15 @@ class CloudRunnerCustomHooks {
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
static ParseHooks(steps) {
|
static ParseHooks(hooks) {
|
||||||
if (steps === '') {
|
if (hooks === '') {
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
// if (CloudRunner.buildParameters?.cloudRunnerIntegrationTests) {
|
// if (CloudRunner.buildParameters?.cloudRunnerIntegrationTests) {
|
||||||
// CloudRunnerLogger.log(`Parsing build hooks: ${steps}`);
|
// CloudRunnerLogger.log(`Parsing build hooks: ${steps}`);
|
||||||
// }
|
// }
|
||||||
const isArray = steps.replace(/\s/g, ``)[0] === `-`;
|
const isArray = hooks.replace(/\s/g, ``)[0] === `-`;
|
||||||
const object = isArray ? yaml_1.default.parse(steps) : [yaml_1.default.parse(steps)];
|
const object = isArray ? yaml_1.default.parse(hooks) : [yaml_1.default.parse(hooks)];
|
||||||
for (const hook of object) {
|
for (const hook of object) {
|
||||||
CloudRunnerCustomHooks.ConvertYamlSecrets(hook);
|
CloudRunnerCustomHooks.ConvertYamlSecrets(hook);
|
||||||
if (hook.secrets === undefined) {
|
if (hook.secrets === undefined) {
|
||||||
|
@ -4801,7 +4801,7 @@ class CloudRunnerCustomHooks {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (object === undefined) {
|
if (object === undefined) {
|
||||||
throw new Error(`Failed to parse ${steps}`);
|
throw new Error(`Failed to parse ${hooks}`);
|
||||||
}
|
}
|
||||||
return object;
|
return object;
|
||||||
}
|
}
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -35,7 +35,7 @@ export class CloudRunnerCustomHooks {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return output.filter((x) => x.step !== undefined && x.hook !== undefined && x.hook.length > 0);
|
return output.filter((x) => x.hook !== undefined && x.hook.length > 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
static GetCustomHooksFromFiles(hookLifecycle: string): Hook[] {
|
static GetCustomHooksFromFiles(hookLifecycle: string): Hook[] {
|
||||||
|
@ -77,8 +77,8 @@ export class CloudRunnerCustomHooks {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public static ParseHooks(steps: string): Hook[] {
|
public static ParseHooks(hooks: string): Hook[] {
|
||||||
if (steps === '') {
|
if (hooks === '') {
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -87,8 +87,8 @@ export class CloudRunnerCustomHooks {
|
||||||
// CloudRunnerLogger.log(`Parsing build hooks: ${steps}`);
|
// CloudRunnerLogger.log(`Parsing build hooks: ${steps}`);
|
||||||
|
|
||||||
// }
|
// }
|
||||||
const isArray = steps.replace(/\s/g, ``)[0] === `-`;
|
const isArray = hooks.replace(/\s/g, ``)[0] === `-`;
|
||||||
const object: Hook[] = isArray ? YAML.parse(steps) : [YAML.parse(steps)];
|
const object: Hook[] = isArray ? YAML.parse(hooks) : [YAML.parse(hooks)];
|
||||||
for (const hook of object) {
|
for (const hook of object) {
|
||||||
CloudRunnerCustomHooks.ConvertYamlSecrets(hook);
|
CloudRunnerCustomHooks.ConvertYamlSecrets(hook);
|
||||||
if (hook.secrets === undefined) {
|
if (hook.secrets === undefined) {
|
||||||
|
@ -96,7 +96,7 @@ export class CloudRunnerCustomHooks {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (object === undefined) {
|
if (object === undefined) {
|
||||||
throw new Error(`Failed to parse ${steps}`);
|
throw new Error(`Failed to parse ${hooks}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
return object;
|
return object;
|
||||||
|
|
Loading…
Reference in New Issue