Skip to content

Commit

Permalink
DOP-4414 push to preprd
Browse files Browse the repository at this point in the history
  • Loading branch information
anabellabuckvar committed Mar 14, 2024
1 parent c15f5bb commit 39f729d
Showing 1 changed file with 31 additions and 21 deletions.
52 changes: 31 additions & 21 deletions api/controllers/v2/github.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ import { MONOREPO_NAME } from '../../../src/monorepo/utils/monorepo-constants';
const SMOKETEST_SITES = [
'docs-landing',
'cloud-docs',
'docs-realm',
'docs',
'docs-atlas-cli',
'docs-ecosystem',
'docs-node',
'docs-app-services',
// 'docs-realm',
// 'docs',
// 'docs-atlas-cli',
// 'docs-ecosystem',
// 'docs-node',
// 'docs-app-services',
];

async function prepGithubPushPayload(
Expand Down Expand Up @@ -224,22 +224,32 @@ export const triggerSmokeTestAutomatedBuild = async (event: APIGatewayEvent): Pr

//add logic for getting master branch, latest stable branch
const job = await prepGithubPushPayload(body, payload, jobTitle);
deployable.push(job);
}

try {
await jobRepository.insertBulkJobs(deployable, c.get('jobsQueueUrl'));

// notify the jobUpdatesQueue
await Promise.all(
deployable.map(async ({ jobId }) => {
await jobRepository.notify(jobId, c.get('jobUpdatesQueueUrl'), JobStatus.inQueue, 0);
consoleLogger.info(jobId, `Created Job ${jobId}`);
})
);
} catch (err) {
consoleLogger.error('deployRepo', err);
try {
consoleLogger.info(job.title, 'Creating Job');
const jobId = await jobRepository.insertJob(job, c.get('jobsQueueUrl'));
jobRepository.notify(jobId, c.get('jobUpdatesQueueUrl'), JobStatus.inQueue, 0);
consoleLogger.info(job.title, `Created Job ${jobId}`);
deployable.push(jobId);
} catch (err) {
consoleLogger.error('TriggerBuildError', err + repoName);
}
// deployable.push(job);
}
return deployable;

// try {
// await jobRepository.insertBulkJobs(deployable, c.get('jobsQueueUrl'));

// // notify the jobUpdatesQueue
// await Promise.all(
// deployable.map(async ({ jobId }) => {
// await jobRepository.notify(jobId, c.get('jobUpdatesQueueUrl'), JobStatus.inQueue, 0);
// consoleLogger.info(jobId, `Created Job ${jobId}`);
// })
// );
// } catch (err) {
// consoleLogger.error('TriggerBuildError', err+ );
// }
}

let returnVal;
Expand Down

0 comments on commit 39f729d

Please sign in to comment.