Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

slack demo #1

Open
wants to merge 16 commits into
base: master
Choose a base branch
from
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,6 @@ By now, your pipeline should be performing its initial deploy of your applicatio
# More demo topics coming soon...

* Deploy the above AWS CodePipeline "demo-app" using Hashicorps [TERRAFORM](terraform/TERRAFORM.md) [Infrastructure as Code tool](https://www.terraform.io/#writ) and its [AWS Provider](https://www.terraform.io/docs/providers/aws/)
* To see how to add Slack notifications, follow [SLACK](slack/SLACK.md).
* To see how to add Slack notifications, see [SLACK](slack/SLACK.md)
* For auto merging dev to master after passing tests, see [MERGE](merge/MERGE.md)
* Integrate with [AWS Config](awsconfig/AWSCONFIG.md)
37 changes: 34 additions & 3 deletions slack/SLACK.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,38 @@
# CodePipeline Slack Integration Demo

This demo builds on the "Versioning Demo" in README.md of this repo. If you haven't already performed the steps captured in README.md, do so now. They must be completed prior to continuing on with this demo.
NOTE: This demo builds on the [CodePipeline Versioning Demo](../README.md) covered in the top level README of this repo. If you haven't already performed those steps, please do so now. They must be completed prior to continuing on with this demo. You must also already have a Slack account and be the Owner of a Workspace. Otherwise, they are free and easy to setup.

WORK IN PROGRESS. CHECK BACK LATER.
## Background

App Developers & Testers can benefit from gettings a "heads up" notification that a new App version has been deployed/released to a specific environment (Test, Stage, Prod,...). This can trigger them to perform a manual validation of a new feature before promoting the change all the way to the production version of the Application. Or it can just be a way to quickly figure out what version is on what stage of the pipeline.

Here are some facts about how we'll be interacting with Slack. In depth understanding of each is not required but check out the links if you are unfamiliar with any.
* Type of integration
* [Slack Internal Integration](https://api.slack.com/internal-integrations)
* Method of integration
* [Slack Webhooks](https://api.slack.com/incoming-webhooks#sending_messages)
* More [webhook](https://en.wikipedia.org/wiki/Webhook) details
* Integration tool
* [curl](https://curl.haxx.se/) details

## Procedures

https://api.slack.com/internal-integrations
1. Using a web browser, log into the [Slack workspace](https://slack.com/signin) where you want AWS CodePipeline to send notifications
1. Browse to https://api.slack.com
1. Select the option to create a New App
1. Name = `pipeline`
1. Select `Incoming Webhooks` and enable it
1. Select `Add new webhook to workspace`
1. Choose a channel and select `Authorize`
1. Take down your webhook URL
1. Test your webhook using the [message.json](slack/message.json) file in this repo by issuing the command below from your development workstation
```
curl -X POST -H 'Content-type: application/json' --data @message.json https://hooks.slack.com/services/<YOUR-UNIQUE-WEBHOOK-VALUE>
```
* You should see the contents of `message.json` show up within in your Slack channel!

Now lets update the Appspec file from this repo to include a new `AfterInstall` step that will send build specific information into your teams slack channel for alerting when new deploys have rolled out.

For developers, the most helpful details to see in Slack would be their last git commit comment. Here is a [conversation](https://forums.aws.amazon.com/thread.jspa?threadID=226646) about ways to grab git repo metadata.

WORK IN PROGRESS. CHECK BACK LATER.