Skip to content

AWS Lambda task to interpret GitHub SNS events and route to an AWX server template API.

Notifications You must be signed in to change notification settings

RoundingWellOS/GitHub2AWX

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GitHub 2 AWX

Purpose

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.

Configuration

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.

Installation

After you've cloned this repository,

  1. Run npm install
  2. Type node_modules/node-lambda/bin/node-lambda setup to create the .env and configuration files for the node-lambda module.
  3. Type Type node_modules/node-lambda/bin/node-lambda run to test your package.
  4. Type node_modules/node-lambda/bin/node-lambda package to build your deploy package
  5. Type node_modules/node-lambda/bin/node-lambda deploy to deploy your package.

For more infomration, see the node-lambda README

Test data

The test-data directory contains a few data examples of GitHub SNS events for testing.

About

AWS Lambda task to interpret GitHub SNS events and route to an AWX server template API.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published