[BETA] Deploying to Heroku

WARNING! This is a new sub-generator, of BETA quality. Use it at your own risk! Feedback is highly welcome!

This sub-generator allows to deploy automatically your JHipster application to the Heroku cloud.

Limitations

This sub-generator has a few limitations:

  • You can only use it with a Postgresql database, as this is what Heroku provides by default
  • You can only use it with the Grunt option (which is the recommended default), as it's the only one providing tasks for deploying
  • You can use it with either Maven or Gradle
  • If your applicaiton is killed by Heroku when your Liquibase changelog is being applied, your database will be marked as "locked" by Liquibase. You will need to manually clean the lock table

Running the sub-generator

Before running the sub-generator, you need to install the Heroku toolbelt, and have a Heroku account created.

Be sure that you got logged on Heroku following the documentation, in section getting started:

heroku login
Enter your Heroku credentials.
Email: YOUR_EMAIL
Password (typing will be hidden): YOUR_PASSWORD
Authentication successful.

To deploy your application to Heroku, type:

yo jhipster:heroku

This should package your application in "production" mode, create an Heroku application (with a Postgresql database), upload your code, and start the application.

If you use the free version of Heroku, please be aware that your application must start under 60 seconds, or it will be killed. Depending on the platform load, starting under 60 seconds is of course not guaranteed!

Updating your deployed application

When your application is already deployed, you can prepare a new deployment by typing:

grunt deployHeroku

Then you can check your application, which is ready for deployment, in your "deploy/heroku" folder. If you are ready to deploy, you can push it to production, by typing (in your "deploy/heroku" folder):

git push

More information