GithubHelp home page GithubHelp logo

eve's Introduction

EVE

A bot to notify Slack users when their GitHub changes have been deployed on Heroku

Running

  1. 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.
  2. Download a private key to authenticate as the GitHub App
  3. Create a Slack App at https://api.slack.com/apps.
    • Configure "Permissions" and add the "Bot Token Scopes" of chat:write and im:write
    • Install the app via "Install App to Workspace" and copy "Bot User OAuth Access Token"
  4. Create a Heroku auth token.
    heroku authorizations:create -d 'eve credentials' -s read-protected
    
  5. 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"

Development

# build
cargo build

# test
cargo test

# format
cargo format

# lint
cargo clippy --all-targets --all-features -- -D clippy::nursery

Deployment to Heroku

  1. Create a Heroku app
  2. Initialize your Heroku app: heroku git:remote -a my-app-name
  3. Add the Rust buildpack: heroku buildpacks:set emk/rust
  4. Push your app to Heroku: git push heroku master
  5. Configure environment variables via the dashboard or heroku config:set KEY=VALUE
  6. 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.

eve's People

Contributors

chdsbd avatar sbdchd avatar

Watchers

 avatar

Forkers

isabella232

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.