Skip to content

Commit

Permalink
Slack notification (#119)
Browse files Browse the repository at this point in the history
* adding slack notification capabilitites

* making slack integration optional

* making slack integration optional

* making slack integration optional

* making slack integration optional

* making slack integration optional

* changing slack notification plugin

* changing slack plugin

* changing slack plugin

* changing slack plugin

* changing slack plugin

* changing slack plugin

* running slack notification on condition

* running slack notification on condition

* running slack notification on condition

* running slack notification on condition

* running slack notification on condition

* setting slack integration to no

* changing slack plugin

* changing slack plugin

* changing slack plugin

* adding slack info to README file

* updating if statement logic

* updating if statement logic

* testing env.branch_name in bash

* setting slack to notify on failure

* setting slack to notify on failure

* failing test on purpose

* failing test on purpose

* cleaning up code

* running prettier

* removing SLACK_INTEGRSTION from var list and re-adding local dev doc to readme

* running prettier

* fixing Readme file

Co-authored-by: Ishmeal Baawuah <ibaawuah@Ishmeals-MacBook-Pro.local>
  • Loading branch information
joeaero19 and Ishmeal Baawuah committed Feb 26, 2021
1 parent db37435 commit db454f9
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 0 deletions.
1 change: 1 addition & 0 deletions .github/build_vars.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ var_list=(
'AWS_SECRET_ACCESS_KEY'
'AWS_DEFAULT_REGION'
'STAGE_PREFIX'
'SLACK_WEBHOOK_URL'
)

set_value() {
Expand Down
7 changes: 7 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ jobs:
AWS_SECRET_ACCESS_KEY: ${{ secrets[env.BRANCH_SPECIFIC_VARNAME_AWS_SECRET_ACCESS_KEY] || secrets.AWS_SECRET_ACCESS_KEY }}
AWS_DEFAULT_REGION: ${{ secrets[env.BRANCH_SPECIFIC_VARNAME_AWS_DEFAULT_REGION] || secrets.AWS_DEFAULT_REGION }}
STAGE_PREFIX: ${{ secrets.STAGE_PREFIX }}
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
- name: lock this branch to prevent concurrent builds
run: ./.github/github-lock.sh
env:
Expand Down Expand Up @@ -78,3 +79,9 @@ jobs:
with:
name: test_results
path: tests/nightwatch/tests_output
- name: Slack notification
if: env.SLACK_WEBHOOK_URL != '' && contains(fromJson('["develop", "main", "master", "impl", "val", "prod", "production"]'), env.branch_name) && always ()
uses: ravsamhq/notify-slack-action@master
with:
status: ${{ job.status }}
notify_when: "failure"
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,20 @@ Additionally, we waive copyright and related rights in the
work worldwide through the CC0 1.0 Universal public domain dedication.
```

## Slack channel

To enable slack integration, set a value for SLACK_WEBHOOK_URL in github actions secret.

To set the SLACK_WEBHOOK_URL:

- Go to https://api.slack.com/apps
- Create new app : fill in the information
- Add features and funtionality----Incoming webhooks--- activative incoming webooks--- Add new webhook to workspace.
- copy new webhook url and set it as SLACK_WEBHOOK_URL in github actions secret.

Please join the macpro-quickstart-serverless slack channel to get all build status and also contribute to any ongoing discussions.
Join here: https://join.slack.com/t/macproquickst-ugp3045/shared_invite/zt-mdxpbtkk-SrLRi_yzJrXX3uYgvrbjlg

### Contributors

This project made possible by the [Serverless Stack](https://serverless-stack.com/) and its authors/contributors. The extremely detailed tutorial, code examples, and serverless pattern is where this project started. I can't recommend this resource enough.
Expand Down

0 comments on commit db454f9

Please sign in to comment.