Skip to content

Commit

Permalink
cd further into project
Browse files Browse the repository at this point in the history
  • Loading branch information
mmeigs committed Oct 16, 2023
1 parent 028a442 commit 7b6e3b8
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
12 changes: 7 additions & 5 deletions src/job/jobHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand All @@ -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);
Expand Down Expand Up @@ -291,7 +291,9 @@ export abstract class JobHandler {
private async callWithBenchmark(command: string, stage: string): Promise<CommandExecutorResponse> {
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}`);

Expand Down Expand Up @@ -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',
Expand Down Expand Up @@ -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`,
];
Expand Down
6 changes: 5 additions & 1 deletion src/services/commandExecutor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,11 @@ export class GithubCommandExecutor extends ShellCommandExecutor implements IGith
branchName: string,
newHead: string | null | undefined = null
): Promise<CommandExecutorResponse> {
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} .`);
}
Expand Down

0 comments on commit 7b6e3b8

Please sign in to comment.