https://github.com/cludden/tf-codebuild-sns-slack
a node.js lambda function that forwards codebuild events to slack via SNS
https://github.com/cludden/tf-codebuild-sns-slack
Last synced: 2 months ago
JSON representation
a node.js lambda function that forwards codebuild events to slack via SNS
- Host: GitHub
- URL: https://github.com/cludden/tf-codebuild-sns-slack
- Owner: cludden
- License: mit
- Created: 2017-11-10T22:51:03.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2018-08-27T22:21:30.000Z (almost 7 years ago)
- Last Synced: 2025-02-14T10:17:59.483Z (4 months ago)
- Language: JavaScript
- Size: 71.3 KB
- Stars: 1
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE.md
Awesome Lists containing this project
README
# tf-codebuild-sns-slack
a `node.js` lambda function that forwards `CodeBuild` events to `Slack` via `SNS`
![]()
## Installing
```shell
# clone the repo and install dependencies
$ git clone [email protected]:cludden/tf-codebuild-sns-slack.git
```## Contributing
1. Clone it (`git clone [email protected]:cludden/tf-codebuild-sns-slack.git`)
1. Create your feature branch (`git checkout -b my-new-feature`)
1. Commit your changes using [conventional changelog standards](https://github.com/bcoe/conventional-changelog-standard/blob/master/convention.md) (`git commit -m 'feat(my-new-feature): Add some feature'`)
1. Push to the branch (`git push origin my-new-feature`)
1. Ensure linting/security/tests are all passing
1. Create new Pull Request## Testing
Prerequisites:
- [Docker & Compose](https://store.docker.com/search?offering=community&type=edition))```shell
# run test suite and generate code coverage
$ docker-compose run tf-codebuild-sns-slack# run linter
$ docker-compose run tf-codebuild-sns-slack npm run lint# run security scan
$ docker-compose run tf-codebuild-sns-slack npm run sec
```## Building
```
$ docker-compose run tf-codebuild-sns-slack
```## Releasing
1. Merge fixes & features to master
1. Run lint check `npm run lint`
1. Run security check `npm run sec`
1. Run full test suite `docker-compose run tf-codebuild-sns-slack`
1. Run release script `npm run release`
1. Push release & release tag to github `git push --follow-tags`
1. [Publish new release](https://help.github.com/articles/creating-releases/) in github, using the release notes from the [CHANGELOG](./CHANGELOG)## Configuring
Define custom configuration
```json
{
"slack": {
"webhookUrl": "xxxx"
},
"log": {
"level": "info"
}
}
```Add JSON configuration to ssm
```shell
$ aws ssm put-parameter --name /secrets/codebuild-sns-slack/custom --type SecureString --value $JSONCONFIG
```## Deploying
Via terraform
```
module "codebuild_trigger" {
source = "git::[email protected]:cludden/tf-codebuild-sns-slack.git//terraform?ref={version}"
additional_parameter_names = "/secrets/codebuild-sns-slack/custom"
config_parameter_name = "/secrets/codebuild-sns-slack"
debug = ""
memory_size = 128
name = "codebuild-sns-slack"
node_env = "production"
region = "us-west-2"
s3_bucket = "my-artifact-bucket"
s3_key = "tf-codebuild-sns-slack/${var.version}/index.zip"
timeout = 10
}
```## License
Licensed under the [MIT License](LICENSE.md)Copyright (c) 2017 Chris Ludden