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
Login / Signup to Hoop
shellhoop login
Create an agent authentication key
shellAGENT_NAME=dev HOOP_KEY=$(hoop create agent $AGENT_NAME --mode embedded)
Clone the heroku ruby getting started repository
shellAPP_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
shellheroku apps:create --buildpack heroku/ruby $APP_NAME
Add the hoop buildpack
shellheroku buildpacks:add --app $APP_NAME \ --index 1 https://github.com/hoophq/heroku-hoop-buildpack
Configure the required environment variables
The agent key is the required credentials to authenticate the agent within hoop.
shellheroku config:set HOOP_KEY=$HOOP_KEY
Edit the main Procfile to start hoop in the background
shellecho 'web: hoopstart -- bundle exec puma -C config/puma.rb' > Procfile # deploy it git commit -am 'add hoopstart' git push heroku main
Connect It
Create the connection and associate with the agent
shellhoop admin create connection $APP_NAME -a $AGENT_NAME
Now it’s possible to open an interactive console with the deployed application.
shellhoop connect $APP_NAME
Or run ad-hoc commands
shellhoop exec $APP_NAME <<EOF rails runner "puts Hello World" EOF
See
Features to explore how to enhance the experience of connections