Skip to content

Commit

Permalink
remove steps that should not be used
Browse files Browse the repository at this point in the history
  • Loading branch information
mmeigs committed Nov 28, 2023
1 parent 4cb8bbb commit f11e4b5
Showing 1 changed file with 27 additions and 26 deletions.
53 changes: 27 additions & 26 deletions src/job/jobHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -328,6 +328,7 @@ export abstract class JobHandler {

// call prerequisite commands
await this._commandExecutor.execute(prerequisiteCommands);
await this._logger.save(this.currJob._id, `${'DONE with prereqs!!'.padEnd(15)}`);

// create constants for command inputs
const thisLogger = this._logger;
Expand All @@ -354,32 +355,32 @@ export abstract class JobHandler {
await nextGenHtml(preppedLogger);
this._logger.save(this._currJob._id, 'NextGenHtml Finished');

for (const command of makeCommands) {
// works for any make command with the following signature make <make-rule>
const key = command.split(' ')[1].trim();
this._logger.save(this.currJob._id, `command: ${command}`);
if (commandMap[key]) {
this._logger.save(this.currJob._id, `running from commandMap: ${key}`);
await commandMap[key]({ job: this.currJob, preppedLogger });
} else if (key === 'next-gen-html') {
this._logger.save(this.currJob._id, `running nextGenHtml!`);
await nextGenHtml(preppedLogger);
} else {
if (stages[key]) {
const makeCommandsWithBenchmarksResponse = await this.callWithBenchmark(command, stages[key]);
await this.logBuildDetails(makeCommandsWithBenchmarksResponse);
} else {
const makeCommandsResp = await this._commandExecutor.execute([command]);
await this.logBuildDetails(makeCommandsResp);
}
}

// Call Gatsby Cloud preview webhook after persistence module finishes for staging builds
const isFeaturePreviewWebhookEnabled = process.env.GATSBY_CLOUD_PREVIEW_WEBHOOK_ENABLED?.toLowerCase() === 'true';
if (key === 'persistence-module' && this.name === 'Staging' && isFeaturePreviewWebhookEnabled) {
await this.callGatsbyCloudWebhook();
}
}
// for (const command of makeCommands) {
// // works for any make command with the following signature make <make-rule>
// const key = command.split(' ')[1].trim();
// this._logger.save(this.currJob._id, `command: ${command}`);
// if (commandMap[key]) {
// this._logger.save(this.currJob._id, `running from commandMap: ${key}`);
// await commandMap[key]({ job: this.currJob, preppedLogger });
// } else if (key === 'next-gen-html') {
// this._logger.save(this.currJob._id, `running nextGenHtml!`);
// await nextGenHtml(preppedLogger);
// } else {
// if (stages[key]) {
// const makeCommandsWithBenchmarksResponse = await this.callWithBenchmark(command, stages[key]);
// await this.logBuildDetails(makeCommandsWithBenchmarksResponse);
// } else {
// const makeCommandsResp = await this._commandExecutor.execute([command]);
// await this.logBuildDetails(makeCommandsResp);
// }
// }

// // Call Gatsby Cloud preview webhook after persistence module finishes for staging builds
// const isFeaturePreviewWebhookEnabled = process.env.GATSBY_CLOUD_PREVIEW_WEBHOOK_ENABLED?.toLowerCase() === 'true';
// if (key === 'persistence-module' && this.name === 'Staging' && isFeaturePreviewWebhookEnabled) {
// await this.callGatsbyCloudWebhook();
// }
// }
await this._logger.save(this.currJob._id, `${'(BUILD)'.padEnd(15)}Finished Build`);
}

Expand Down

0 comments on commit f11e4b5

Please sign in to comment.