Skip to content

Commit

Permalink
add build deps & nextgenhtml
Browse files Browse the repository at this point in the history
  • Loading branch information
mmeigs committed Nov 22, 2023
1 parent 1d45d72 commit 11bac2c
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/commands/src/shared/next-gen-html.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import path from 'path';
import { IJobRepoLogger } from '../../../services/logger';
import { executeCliCommand } from '../helpers';

export async function nextGenHtml(repoName: string) {
export async function nextGenHtml() {
// let cwd = path.join(`${process.cwd()}`, `../../../snooty`);
// if (repoName === 'docs-monorepo') {
// cwd = path.join(`${process.cwd()}`, `../../snooty`);
Expand Down
2 changes: 1 addition & 1 deletion src/entrypoints/localApp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ async function localApp() {

console.log('Begin next-gen-html...');

const nextGenHtmlRes = await nextGenHtml(repoName);
const nextGenHtmlRes = await nextGenHtml();
console.log(nextGenHtmlRes.outputText);

console.log('next-gen-html complete');
Expand Down
15 changes: 14 additions & 1 deletion src/job/jobHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,13 @@ import { IJobValidator } from './jobValidator';
import { RepoEntitlementsRepository } from '../repositories/repoEntitlementsRepository';
import { DocsetsRepository } from '../repositories/docsetsRepository';
import { MONOREPO_NAME } from '../monorepo/utils/monorepo-constants';
import { nextGenHtml, nextGenParse, oasPageBuild, persistenceModule } from '../commands';
import {
nextGenHtml,
nextGenParse,
oasPageBuild,
persistenceModule,
prepareBuildAndGetDependencies,
} from '../commands';
import { getRepoDir } from '../commands/src/helpers';
require('fs');

Expand Down Expand Up @@ -330,6 +336,7 @@ export abstract class JobHandler {
const preppedLogger = (message: string) => {
thisLogger.save(thisJob._id, message);
};
const baseUrl = 'https://mongodbcom-cdn.website.staging.corp.mongodb.com'; // ?????

for (const command of makeCommands) {
// works for any make command with the following signature make <make-rule>
Expand All @@ -338,6 +345,12 @@ export abstract class JobHandler {
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();
} else if (key === 'get-build-dependencies') {
this._logger.save(this.currJob._id, `running getBuildStuff!!`);
await prepareBuildAndGetDependencies(this.currJob.payload.repoName, thisJob.payload.project, baseUrl);
} else {
if (stages[key]) {
const makeCommandsWithBenchmarksResponse = await this.callWithBenchmark(command, stages[key]);
Expand Down

0 comments on commit 11bac2c

Please sign in to comment.