This tool originated as a way for us to utilize Ansible AWX to automate code builds in our primary code repository.While we use an after_success
block in our .travis.yml
configuration for pull request builds, we needed a solution that would also build develop after commits were merged and any release builds.
There are 2 required environment variables. 1. TEMPLATE_URL - URL to the AWX job template you want to call ie. https:///api/v2/job_templates//launch/ 2. AWX_TOKEN - The Oauth token used to access the AWX API. See AWX's docs.
Additionally, your payloads may require different extra_vars. Update the postData
object in index.js
to reflect your environment's needs.
We're using the Amazon SNS service in GitHub. got to https://github.com///settings/installations and select the drop-down next to Services to add the Amazon SNS service.
See the blog post Dynamic GitHub Actions with AWS Lambda from Amazon for instructions on configuring the service and creating your Lambda function.
After you've cloned this repository,
- Run
npm install
- Type
node_modules/node-lambda/bin/node-lambda setup
to create the .env and configuration files for the node-lambda module. - Type Type
node_modules/node-lambda/bin/node-lambda run
to test your package. - Type
node_modules/node-lambda/bin/node-lambda package
to build your deploy package - Type
node_modules/node-lambda/bin/node-lambda deploy
to deploy your package.
For more infomration, see the node-lambda README
The test-data directory contains a few data examples of GitHub SNS events for testing.