twitter/finatra — pull request #181 by tomjadams (2014-11-24 03:30:05+00:00)
Title: Fix heroku deployments for template project

As per issue https://github.com/twitter/finatra/issues/180

The included deployment (well, the assembly plugin) does not work against heroku. In short, heroku expects to call `stage` and the shipped plugin uses `assembly`:

I made a few changes to get it working:

1. Added the native packager plugin to `project/plugins.sbt`

addSbtPlugin("com.typesafe.sbt" % "sbt-native-packager" % "0.8.0-RC1")

1. Removed the `assembly_plugin.sbt` file.

1. Added the necessary references to build.sbt

import NativePackagerKeys._
packageArchetype.java_application

1. Changed procfile as follows:

web: target/universal/stage/bin/ -Dcom.twitter.finatra.config.env=$ENV -Dcom.twitter.finatra.config.adminPort=$ADMIN_PORT -Dcom.twitter.finatra.config.port=:$PORT

Notes.

1. I added the `$ADMIN_PORT` environment variable so I can run `formate start` on the local command line to have the app boot via the `Procfile`.

1. I added `$ENV` for the same reason, so that the `development` or whatever environment can be passed locally while still using the production style startup process.

1. These require a `.env` file with those parameters defined as follows:

PORT=7070
ADMIN_PORT=:9990
ENV=development