From 7b6e3b8cc530d1f8b2da8d155d560a4bdc5333ec Mon Sep 17 00:00:00 2001 From: Matt Meigs Date: Mon, 16 Oct 2023 14:31:56 -0400 Subject: [PATCH] cd further into project --- src/job/jobHandler.ts | 12 +++++++----- src/services/commandExecutor.ts | 6 +++++- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/src/job/jobHandler.ts b/src/job/jobHandler.ts index ca616bdac..a48d2ee85 100644 --- a/src/job/jobHandler.ts +++ b/src/job/jobHandler.ts @@ -213,7 +213,7 @@ export abstract class JobHandler { if (this.currJob.payload.repoName === 'docs-monorepo') { await this._fileSystemServices.saveUrlAsFile( `https://raw.githubusercontent.com/mongodb/docs-worker-pool/meta/makefiles/Makefile.${this.currJob.payload.project}`, - `repos/${this.currJob.payload.project}/Makefile`, + `repos/${this.currJob.payload.project}/cloud-docs/Makefile`, { encoding: 'utf8', flag: 'w', @@ -239,7 +239,7 @@ export abstract class JobHandler { public isbuildNextGen(): boolean { let workerPath = `repos/${this.currJob.payload.repoName}/worker.sh`; if (this.currJob.payload.repoName === 'docs-monorepo') - workerPath = `repos/${this.currJob.payload.project}/worker.sh`; + workerPath = `repos/${this.currJob.payload.project}/cloud-docs/worker.sh`; // const workerPath = `repos/${this.currJob.payload.repoName}/worker.sh`; if (this._fileSystemServices.rootFileExists(workerPath)) { const workerContents = this._fileSystemServices.readFileAsUtf8(workerPath); @@ -291,7 +291,9 @@ export abstract class JobHandler { private async callWithBenchmark(command: string, stage: string): Promise { const start = performance.now(); const pathToRepo = - this.currJob.payload.repoName === 'docs-monorepo' ? `repos/cloud-docs` : `repos/${this.currJob.payload.repoName}`; + this.currJob.payload.repoName === 'docs-monorepo' + ? `repos/cloud-docs/cloud-docs` + : `repos/${this.currJob.payload.repoName}`; const resp = await this._commandExecutor.execute([command], pathToRepo); // const resp = await this._commandExecutor.execute([command], `repos/${this.currJob.payload.repoName}`); @@ -404,7 +406,7 @@ export abstract class JobHandler { } let fileToWriteTo = `repos/${this.currJob.payload.repoName}/.env.production`; if (this.currJob.payload.repoName === 'docs-monorepo') - fileToWriteTo = `repos/${this.currJob.payload.project}/.env.production`; + fileToWriteTo = `repos/${this.currJob.payload.project}/cloud-docs/.env.production`; this._fileSystemServices.writeToFile(fileToWriteTo, envVars, { encoding: 'utf8', flag: 'w', @@ -458,7 +460,7 @@ export abstract class JobHandler { this._logger.save(this.currJob._id, 'IN PREP, using cloud-docs'); this.currJob.buildCommands = [ `. /venv/bin/activate`, - `cd repos/${this.currJob.payload.project}`, + `cd repos/${this.currJob.payload.project}/cloud-docs`, `rm -f makefile`, `make html`, ]; diff --git a/src/services/commandExecutor.ts b/src/services/commandExecutor.ts index 9221cfc51..84dfaea5a 100644 --- a/src/services/commandExecutor.ts +++ b/src/services/commandExecutor.ts @@ -100,7 +100,11 @@ export class GithubCommandExecutor extends ShellCommandExecutor implements IGith branchName: string, newHead: string | null | undefined = null ): Promise { - const pullRepoCommands = [`cd repos/${repoDirName}`, `git checkout ${branchName}`, `git pull origin ${branchName}`]; + const pullRepoCommands = [ + `cd repos/${repoDirName}/cloud-docs`, + `git checkout ${branchName}`, + `git pull origin ${branchName}`, + ]; if (newHead) { pullRepoCommands.push(`git checkout ${newHead} .`); }