Skip to content

Mindflash/tf-github-webhooks-cludden-copy

 
 

Repository files navigation

tf-github-webhooks

a node.js lambda function that publishes authorized github events to SNS

architecture diagram

Installing

# clone this repository
$ git clone git@github.com/cludden/tf-github-webhooks.git

# if developing locally
$ cd tf-github-webhooks && nvm use && npm install

Contributing

  1. Clone it (git clone git@github.com:cludden/tf-github-webhooks.git)
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes using conventional changelog standards (git commit -am 'feat: adds my new feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Ensure linting/security/tests are all passing
  6. Create new Pull Request

Testing

This project uses:

  • docker for consistent testing and build environments.

Prerequisities:

Testing:

# run all tests
$ docker-compose run tf-github-webhooks

Linting:

# run lint
$ docker-compose run tf-github-webhooks npm run lint

Security:

# run security check
$ docker-compose run tf-github-webhooks npm run sec

Building

To build locally:

$ docker-compose run tf-github-webhooks npm run build

Releasing

  1. Merge fixes & features to master
  2. Run lint check npm run lint
  3. Run security check npm run sec
  4. Run full test suite docker-compose run tf-github-webhooks
  5. Run release script npm run release
  6. Push release & release tag to github git push --follow-tags
  7. Publish new release in github, using the release notes from the CHANGELOG

Deploying and Configuring

  1. Build the artifact and push to s3
  2. Use the terraform module
module "github_webhooks" {
    source                = "git::git@github.com:cludden/tf-github-webhooks.git//terraform?ref={version}"
    config_parameter_name = "/secrets/tf-github-webhooks"
    debug                 = ""
    log_level             = "info"
    memory_size           = 128
    name                  = "github-webhooks"
    node_env              = "production"
    region                = "us-west-2"
    s3_bucket             = "my-artifact-bucket"
    s3_key                = "path/to/my/artifact.zip"
    timeout               = 10
}

LICENSE

Licensed under the MIT License

Copyright (c) 2017 Chris Ludden

About

a terraform module that deploys webhook endpoint that publishes github events to sns

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages

  • JavaScript 60.2%
  • HCL 39.8%