Custom step file support
parent
f5faae57d3
commit
820a7e7900
|
|
@ -4430,16 +4430,21 @@ class CloudRunnerCustomSteps {
|
|||
static GetCustomStepsFromFiles(hookLifecycle) {
|
||||
const results = [];
|
||||
remote_client_logger_1.RemoteClientLogger.log(`GetCustomStepFiles: ${hookLifecycle}`);
|
||||
const gameCiCustomStepsPath = path_1.default.join(process.cwd(), `game-ci`, `steps`);
|
||||
const files = fs.readdirSync(gameCiCustomStepsPath);
|
||||
for (const file of files) {
|
||||
const fileContents = fs.readFileSync(path_1.default.join(gameCiCustomStepsPath, file), `utf8`);
|
||||
const fileContentsObject = yaml_1.default.parse(fileContents.toString());
|
||||
if (fileContentsObject.hook === hookLifecycle) {
|
||||
remote_client_logger_1.RemoteClientLogger.log(`Active Step File ${file} contents: ${fileContents}`);
|
||||
results.push(...CloudRunnerCustomSteps.ParseSteps(fileContents));
|
||||
try {
|
||||
const gameCiCustomStepsPath = path_1.default.join(process.cwd(), `game-ci`, `steps`);
|
||||
const files = fs.readdirSync(gameCiCustomStepsPath);
|
||||
for (const file of files) {
|
||||
const fileContents = fs.readFileSync(path_1.default.join(gameCiCustomStepsPath, file), `utf8`);
|
||||
const fileContentsObject = yaml_1.default.parse(fileContents.toString());
|
||||
if (fileContentsObject.hook === hookLifecycle) {
|
||||
remote_client_logger_1.RemoteClientLogger.log(`Active Step File ${file} contents: ${fileContents}`);
|
||||
results.push(...CloudRunnerCustomSteps.ParseSteps(fileContents));
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (error) {
|
||||
remote_client_logger_1.RemoteClientLogger.log(`Failed Getting: ${hookLifecycle} \n ${JSON.stringify(error, undefined, 4)}`);
|
||||
}
|
||||
return results;
|
||||
}
|
||||
static ParseSteps(steps) {
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
|
|
@ -13,15 +13,19 @@ export class CloudRunnerCustomSteps {
|
|||
static GetCustomStepsFromFiles(hookLifecycle: string): CustomStep[] {
|
||||
const results: CustomStep[] = [];
|
||||
RemoteClientLogger.log(`GetCustomStepFiles: ${hookLifecycle}`);
|
||||
const gameCiCustomStepsPath = path.join(process.cwd(), `game-ci`, `steps`);
|
||||
const files = fs.readdirSync(gameCiCustomStepsPath);
|
||||
for (const file of files) {
|
||||
const fileContents = fs.readFileSync(path.join(gameCiCustomStepsPath, file), `utf8`);
|
||||
const fileContentsObject = YAML.parse(fileContents.toString());
|
||||
if (fileContentsObject.hook === hookLifecycle) {
|
||||
RemoteClientLogger.log(`Active Step File ${file} contents: ${fileContents}`);
|
||||
results.push(...CloudRunnerCustomSteps.ParseSteps(fileContents));
|
||||
try {
|
||||
const gameCiCustomStepsPath = path.join(process.cwd(), `game-ci`, `steps`);
|
||||
const files = fs.readdirSync(gameCiCustomStepsPath);
|
||||
for (const file of files) {
|
||||
const fileContents = fs.readFileSync(path.join(gameCiCustomStepsPath, file), `utf8`);
|
||||
const fileContentsObject = YAML.parse(fileContents.toString());
|
||||
if (fileContentsObject.hook === hookLifecycle) {
|
||||
RemoteClientLogger.log(`Active Step File ${file} contents: ${fileContents}`);
|
||||
results.push(...CloudRunnerCustomSteps.ParseSteps(fileContents));
|
||||
}
|
||||
}
|
||||
} catch (error) {
|
||||
RemoteClientLogger.log(`Failed Getting: ${hookLifecycle} \n ${JSON.stringify(error, undefined, 4)}`);
|
||||
}
|
||||
|
||||
return results;
|
||||
|
|
|
|||
Loading…
Reference in New Issue