A bot to notify Slack users when their GitHub changes have been deployed on Heroku
- Create a GitHub App at https://github.com/settings/apps/new.
- Uncheck the Webhook "Active" checkbox
- Enable "Read-only" access to the "Contents" repository permission. This allows Eve to compare commits.
- Download a private key to authenticate as the GitHub App
- Create a Slack App at https://api.slack.com/apps.
- Configure "Permissions" and add the "Bot Token Scopes" of
chat:write
andim:write
- Install the app via "Install App to Workspace" and copy "Bot User OAuth Access Token"
- Configure "Permissions" and add the "Bot Token Scopes" of
- Create a Heroku auth token.
heroku authorizations:create -d 'eve credentials' -s read-protected
- Run Eve
SECRET=my-secret-key \
GITHUB_APP_ID=1047 \
GITHUB_APP_PRIVATE_KEY=$(cat acme-corp-eve.2020-01-01.private-key.pem) \
GITHUB_APP_INSTALL_ID=202154 \
EVE_HEROKU_TOKEN='E5C2E4F1-4727-4E0C-B1F4-EA1BBA3B66C9' \
SLACK_OAUTH_TOKEN='xoxb-c6768786-5f6c43dc-acbeba4045d90c08' \
GITHUB_SLACK_USER_IDS='1929960=UAXQFKA3C 7340772=UAYMB3CNS' \
cargo run
curl "localhost:8000/heroku_deploy_hook?auth_token=$SECRET&github_org_name=acme-corp&github_repo_name=blog"
# build
cargo build
# test
cargo test
# format
cargo format
# lint
cargo clippy --all-targets --all-features -- -D clippy::nursery
- Create a Heroku app
- Initialize your Heroku app:
heroku git:remote -a my-app-name
- Add the Rust buildpack:
heroku buildpacks:set emk/rust
- Push your app to Heroku:
git push heroku master
- Configure environment variables via the dashboard or
heroku config:set KEY=VALUE
- Finished. You could add the app url as a Heroku Post Deploy Hook, like
https://my-app-name.herokuapp.com/heroku_deploy_hook?auth_token=my-secret-key
.