Heroku Quick Start
This guide shows how to interact with workloads and resources in the Heroku Platform.
Requirements
- Have a heroku account to run basic workloads
- Install the heroku command line
- Install Hoop Command Line
- Login / Signup to Hoop
hoop login
# create a client key
DSN_NAME=dev
HOOP_DSN=$(hoop create clientkeys $DSN_NAME)
- Clone the heroku ruby getting started repository
APP_NAME=demo-ruby-$(hexdump -e '/1 "%02x"' -n3 < /dev/urandom)
git clone https://github.com/heroku/ruby-getting-started.git && cd ruby-getting-started
- Create an application using the
heroku/ruby
buildpack
# create a new heroku app using the heroku buildpack
heroku apps:create --buildpack heroku/ruby $APP_NAME
- Add the hoop buildpack
heroku buildpacks:add --app $APP_NAME --index 1 https://github.com/hoophq/heroku-hoop-buildpack
- Configure the required environment variables
The client key allows stablishing the connection to the gateway and making it available in the hoop dashboard.
# configure the client key and the connection name that will be displayed
heroku config:set HOOP_DSN=$HOOP_DSN
heroku config:set HOOP_CONNECTION=$APP_NAME
- Edit the main Procfile to start hoop in the background
echo 'web: hoopstart -- bundle exec puma -C config/puma.rb' > Procfile
# deploy it
git commit -am 'add hoopstart'
git push heroku main
Connect It
Now it's possible to open an interactive console with the deployed application.
hoop connect $DSN_NAME:$APP_NAME
To run ad-hoc commands
hoop exec $DSN_NAME:$APP_NAME <<EOF
rails runner "puts Hello World"
EOF
Explore more features like:
- Enabling more plugins
- Edit the connection entrypoint command to interact with other tools