Skip to content

Commit

Permalink
uncomment prepNextGenBuild
Browse files Browse the repository at this point in the history
  • Loading branch information
mmeigs committed Nov 29, 2023
1 parent 7a10135 commit 9e36e45
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 23 deletions.
11 changes: 1 addition & 10 deletions src/commands/src/shared/next-gen-deploy.ts
Original file line number Diff line number Diff line change
@@ -1,22 +1,13 @@
import { executeAndPipeCommands, executeCliCommand } from '../helpers';

interface NextGenDeployParams {
// bucket: string;
mutPrefix: string;
gitBranch: string;
hasConfigRedirects: boolean;
// url: string;
preppedLogger: (message: string) => void;
}

export async function nextGenDeploy({
// bucket,
mutPrefix,
gitBranch,
hasConfigRedirects,
// url,
preppedLogger,
}: NextGenDeployParams) {
export async function nextGenDeploy({ mutPrefix, gitBranch, hasConfigRedirects, preppedLogger }: NextGenDeployParams) {
try {
if (hasConfigRedirects && (gitBranch === 'main' || gitBranch === 'master')) {
// equivalent to: mut-redirects config/redirects -o public/.htaccess
Expand Down
14 changes: 5 additions & 9 deletions src/entrypoints/localApp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ const fakeJob: Job = {
};

const preppedLogger = (message: string) => {
console.log('hey');
console.log(message);
};

async function localApp() {
Expand Down Expand Up @@ -111,25 +111,21 @@ async function localApp() {
console.log(oasPageBuildRes);
console.log('Begin next-gen-stage...');

// const { resultMessage, commands } = await nextGenStage({
// job: fakeJob,
// preppedLogger,
// });
// console.log(resultMessage);
await nextGenStage({
job: fakeJob,
preppedLogger,
});
console.log('next-gen-stage complete');

console.log('Begin next-gen-deploy...');
const deployRes = await nextGenDeploy({
// bucket,
hasConfigRedirects: hasRedirects,
gitBranch: commitBranch,
mutPrefix: mutPrefix || '',
// url: baseUrl,
preppedLogger,
});
console.log(deployRes);
console.log('next-gen-deploy complete');
// console.log('commands: ', commands);
console.log('bundle Path: ', bundlePath);
}

Expand Down
4 changes: 2 additions & 2 deletions src/job/jobHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -534,8 +534,8 @@ export abstract class JobHandler {
this._logger.save(this._currJob._id, 'Pulled Repo');
// this.prepBuildCommands();
// this._logger.save(this._currJob._id, 'Prepared Build commands');
// await this.prepNextGenBuild();
// this._logger.save(this._currJob._id, 'Prepared Next Gen build');
await this.prepNextGenBuild();
this._logger.save(this._currJob._id, 'Prepared Next Gen build');
await this._repoConnector.applyPatch(this.currJob);
this._logger.save(this._currJob._id, 'Patch Applied');
// await this.downloadMakeFile();
Expand Down
2 changes: 0 additions & 2 deletions src/job/stagingJobHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,12 +97,10 @@ export class StagingJobHandler extends JobHandler {
});
this.logger.save(this.currJob._id, `Now to deploy `);
await nextGenDeploy({
// bucket: 'docs-atlas-dotcomstg',
gitBranch: this.currJob.payload.branchName,
mutPrefix: this.currJob.mutPrefix || '',
hasConfigRedirects: hasConfigRedirects,
preppedLogger: (message: string) => this.logger.save(this.currJob._id, message),
// url: 'https://mongodbcom-cdn.website.staging.corp.mongodb.com',
});
// resp = await this.deployGeneric();
}
Expand Down

0 comments on commit 9e36e45

Please sign in to comment.