Skip to content

Commit

Permalink
more getDirectory
Browse files Browse the repository at this point in the history
  • Loading branch information
mmeigs committed Oct 17, 2023
1 parent fb032c7 commit aa7532f
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions src/job/manifestJobHandler.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// TODO: remove manifest job handler
// not run as a separate job, handled in productionJobHandler prepSearchDeploy

import { JobHandler } from './jobHandler';
import { getDirectory, JobHandler } from './jobHandler';
import { IConfig } from 'config';
import type { Job } from '../entities/job';
import { JobRepository } from '../repositories/jobRepository';
Expand Down Expand Up @@ -100,7 +100,7 @@ export class ManifestJobHandler extends JobHandler {
// For mut-index usage info, see: https://github.com/mongodb/mut/blob/master/mut/index/main.py#L2
this.currJob.deployCommands = [
'. /venv/bin/activate',
`cd repos/${this.currJob.payload.repoName}`,
`cd repos/${getDirectory(this.currJob)}`,
'echo IGNORE: testing manifest generation deploy commands',
'ls -al',
`mut-index upload bundle.zip -b ${b} -o ${f}/${maP}.json -u ${jUaP(url, muP || '')} ${globalSearch}`,
Expand Down
6 changes: 3 additions & 3 deletions src/job/productionJobHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { CommandExecutorResponse, IJobCommandExecutor } from '../services/comman
import { IFileSystemServices } from '../services/fileServices';
import { IJobRepoLogger } from '../services/logger';
import { IRepoConnector } from '../services/repo';
import { JobHandler } from './jobHandler';
import { getDirectory, JobHandler } from './jobHandler';
import { IJobValidator } from './jobValidator';
import { joinUrlAndPrefix } from './manifestJobHandler';

Expand Down Expand Up @@ -49,7 +49,7 @@ export class ProductionJobHandler extends JobHandler {
// TODO: Can we simplify the chain of logic here?
this.currJob.deployCommands = [
'. /venv/bin/activate',
`cd repos/${this.currJob.payload.repoName}`,
`cd repos/${getDirectory(this.currJob)}`,
'make publish && make deploy',
];

Expand Down Expand Up @@ -116,7 +116,7 @@ export class ProductionJobHandler extends JobHandler {
}
const searchCommands = [
'. /venv/bin/activate',
`cd repos/${this.currJob.payload.repoName}`,
`cd repos/${getDirectory(this.currJob)}`,
'echo IGNORE: testing manifest generation deploy commands',
'ls -al',
// For mut-index usage info, see: https://github.com/mongodb/mut/blob/master/mut/index/main.py#L2
Expand Down
4 changes: 2 additions & 2 deletions src/job/stagingJobHandler.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { JobHandler } from './jobHandler';
import { getDirectory, JobHandler } from './jobHandler';
import { IConfig } from 'config';
import type { Job } from '../entities/job';
import { JobRepository } from '../repositories/jobRepository';
Expand Down Expand Up @@ -46,7 +46,7 @@ export class StagingJobHandler extends JobHandler {

prepDeployCommands(): void {
// TODO: Can we make this more readable?
this.currJob.deployCommands = ['. /venv/bin/activate', `cd repos/${this.currJob.payload.repoName}`, 'make stage'];
this.currJob.deployCommands = ['. /venv/bin/activate', `cd repos/${getDirectory(this.currJob)}`, 'make stage'];
if (this.currJob.payload.isNextGen) {
if (this.currJob.payload.pathPrefix) {
this.currJob.deployCommands[
Expand Down

0 comments on commit aa7532f

Please sign in to comment.