Skip to content

Instantly share code, notes, and snippets.

@skuppa
Last active July 16, 2017 08:35
Show Gist options
  • Save skuppa/8806325 to your computer and use it in GitHub Desktop.
Save skuppa/8806325 to your computer and use it in GitHub Desktop.
heroku Tips

Tips to work with heroku

Adding key to heroku

It is required so you can push code heroku's git server and deploy

# Make sure the keys are available
ssh-add -l

# Add keys to heroku
heroku keys:add

Adding a new application

# Create application in heroku, this create add git remote repository
heroku create

# verify it is created successfully
git remote -v

# push code and deploy application to heroku
git push heroku master

Adding JDK 7 support

  1. Create file system.properties with content java.runtime.version=1.7
  2. git add -A . && git commit -m "adding support for jdk 7" && git push heroku master

Debugging java application

  1. Update config
heroku config:add JAVA_OPTS='-Xdebug -Xrunjdwp:transport=dt_socket,address=24.5.224.160:9999 -Xms512M -Xmx1024M -Xss1M -XX:+CMSClassUnloadingEnabled -XX:MaxPermSize=256M -XX:+UseCompressedOops' -a mido-platform-staging
  1. Make intellij listen to the port 9999

  2. Restart the heroku

heroku restart

Restart heroku

heroku ps:scale web=0 -a mido-platform-staging

# then

heroku ps:scale web=1 -a mido-platform-staging

or

heroku restart -a mido-platform-staging

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment