feat: Cancel builds!

This commit is contained in:
Andras Bacsai
2022-05-02 14:15:50 +02:00
parent b92bc9eebb
commit 00cab67e73
23 changed files with 207 additions and 65 deletions

View File

@@ -100,11 +100,15 @@ export const post: RequestHandler = async (event) => {
type: 'webhook_commit'
}
});
await buildQueue.add(buildId, {
build_id: buildId,
type: 'webhook_commit',
...applicationFound
});
await buildQueue.add(
buildId,
{
build_id: buildId,
type: 'webhook_commit',
...applicationFound
},
{ jobId: buildId }
);
return {
status: 200,
body: {
@@ -160,13 +164,17 @@ export const post: RequestHandler = async (event) => {
type: 'webhook_pr'
}
});
await buildQueue.add(buildId, {
build_id: buildId,
type: 'webhook_pr',
...applicationFound,
sourceBranch,
pullmergeRequestId
});
await buildQueue.add(
buildId,
{
build_id: buildId,
type: 'webhook_pr',
...applicationFound,
sourceBranch,
pullmergeRequestId
},
{ jobId: buildId }
);
return {
status: 200,
body: {

View File

@@ -73,11 +73,15 @@ export const post: RequestHandler = async (event) => {
type: 'webhook_commit'
}
});
await buildQueue.add(buildId, {
build_id: buildId,
type: 'webhook_commit',
...applicationFound
});
await buildQueue.add(
buildId,
{
build_id: buildId,
type: 'webhook_commit',
...applicationFound
},
{ jobId: buildId }
);
return {
status: 200,
body: {
@@ -156,13 +160,17 @@ export const post: RequestHandler = async (event) => {
type: 'webhook_mr'
}
});
await buildQueue.add(buildId, {
build_id: buildId,
type: 'webhook_mr',
...applicationFound,
sourceBranch,
pullmergeRequestId
});
await buildQueue.add(
buildId,
{
build_id: buildId,
type: 'webhook_mr',
...applicationFound,
sourceBranch,
pullmergeRequestId
},
{ jobId: buildId }
);
return {
status: 200,
body: {