This docker setup builds a bulldozer image with support for running it on AWS Lambda with custom config.
The custom entrypoint can load the GitHub App private key from a base64-encoded environment variable:
- Set
GITHUB_APP_PRIVATE_KEY_BASE64to the base64-encoded PEM private key. - The entrypoint decodes it and exports
GITHUB_APP_PRIVATE_KEYfor bulldozer.
To encode an existing private key:
base64 -i /path/to/private-key.pem | tr -d '\n'The default behavior of bulldozer is to handle GitHub webhook events asynchronously using an async scheduler. This doesn't work well with AWS Lambda because the Lambda runtime is frozen after the request handler returns, which means that any async tasks scheduled in the request handler will not be executed. To work around this, bulldozer can be configured to handle GitHub webhook events synchronously in the request handler.
Our forked repo at https://github.com/NextGenContributions/bulldozer/ supports synchronous GitHub event handling. It's controlled by the BULLDOZER_OPTIONS_SYNCHRONOUS_GITHUB_EVENT_HANDLING environment variable. When set to true, GitHub webhook events are handled synchronously in the request handler. When set to false or unset, events are handled asynchronously just like the original upstream. The default is false.