Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions backend/serverless.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ functions:
- EventBus # Hack 2

buildPusher:
handler: src/lambda/printer.handler
handler: src/lambda/indexBuild.handler
timeout: 30
events:
- eventBridgeLogger:
Expand Down Expand Up @@ -135,7 +135,7 @@ resources:
Properties:
EventBusName:
!Ref EventBus
StatementId: "orgo-pfvi62lki4" # TODO: Replace
StatementId: ${self:provider.stackName}-orgo-pfvi62lki4
Action: "events:PutEvents"
Principal: "*"
Condition:
Expand Down
9 changes: 9 additions & 0 deletions backend/src/lambda/indexBuild.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
const indexBuild = require('../services/build');

const handler = async (event, context) => {
console.log(JSON.stringify({ event, context }));

await indexBuild(event.detail.build.uuid);
};

module.exports = { handler };
7 changes: 7 additions & 0 deletions backend/src/lambda/indexPipelines.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
const { writePipelines } = require('../services/pipelines');

const handler = async (event, context) => {
await writePipelines();
};

module.exports = { handler };
41 changes: 0 additions & 41 deletions backend/src/lambda/printer.js
Original file line number Diff line number Diff line change
@@ -1,46 +1,5 @@
/* {
"version": "0",
"id": "58e9e8c8-2092-c5b2-284d-6a498ab0a9bc",
"detail-type": "Build Created",
"source": "aws.partner/buildkite.com/dale-salter/dcd84cbb-a66f-4659-a2c1-36d141c0de18",
"account": "878489430596",
"time": "2020-06-02T07:11:50Z",
"region": "us-east-1",
"resources": [],
"detail": {
"version": 1,
"build": {
"uuid": "1a5d5209-411c-482e-ab31-ef44b77469ab",
"graphql_id": "QnVpbGQtLS0xYTVkNTIwOS00MTFjLTQ4MmUtYWIzMS1lZjQ0Yjc3NDY5YWI=",
"number": 111,
"commit": "HEAD",
"message": "Manually Triggered",
"branch": "master",
"state": "scheduled",
"source": "ui",
"started_at": null,
"finished_at": null
},
"pipeline": {
"uuid": "00b6f4db-061c-4b54-ba4d-0d07654ab90b",
"graphql_id": "UGlwZWxpbmUtLS0wMGI2ZjRkYi0wNjFjLTRiNTQtYmE0ZC0wZDA3NjU0YWI5MGI=",
"slug": "eng-stats-merge"
},
"organization": {
"uuid": "13d3da51-c3d5-4f27-9391-bbb6d20f3de2",
"graphql_id": "T3JnYW5pemF0aW9uLS0tMTNkM2RhNTEtYzNkNS00ZjI3LTkzOTEtYmJiNmQyMGYzZGUy",
"slug": "dale-salter"
}
}
}
*/

const { indexBuild } = require('./build');

const handler = async (event, context) => {
console.log(JSON.stringify({ event, context }));

await indexBuild(event.detail.build.uuid);
};

module.exports = { handler };
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,4 @@ const writePipelines = async () => {
return buildInserts;
}

const handler = async (event, context) => {
await writePipelines();
};

module.exports = { handler };
module.exports = { writePipelines };