Add "heroku" in build command line to enable easy profile activation#5
Add "heroku" in build command line to enable easy profile activation#5jeanlaurent wants to merge 1 commit intoheroku:masterfrom
Conversation
|
Thanks for the pull request! I'm curious about your local workflow so that I can get the full context around this. How are you building/running in your local environment? |
|
Sorry I was not clear enough. Local workflow is the following :
It's a kind of small optimisation, but quite cheap. I checkout the build pack code, when googling for an answers and finding http://groups.google.com/group/heroku/browse_thread/thread/1695739535398e13 hope you'll find this useful. |
|
As of running the webapp I'm doing it trough unit tests (test start up and shut down the app), or ran the server within the IDE. |
|
I completely agree with the need for something like this. However the problem applies to more than just Java. We're currently investigating a way to solve this problem in a language agnostic manner. I'm sure you've found the BUILDPACK_URL option and figured out that you can run your app with your build pack fork or even share that fork with others to use. I'm going to close this request, but you can run your forked build pack until we have a better solution. Please keep on eye on the Heroku changelog for updates on a better solution or other build pack changes that you may want to pull across into your fork: https://devcenter.heroku.com/changelog |
I just added -Dheroku to the maven command line to enable easy detection of heroku running the build command.
This allows build to detect wether the build is run through heroku or not, with conditional profile activation like this :
Each & every application pom.xml will run with no changes, but some who wants to benefit from it, can, where before we should rely on ugly hacks (like file detection) to know wether or not the build is run through heroku.
This is useful since it speed up the build process when run outside of heroku, (most of the time the local copy dependencies is not useful during a non-heroku build, which is probably more common).
full runnning example to test the build pack :
heroku create --stack cedar --buildpack http://github.com/jeanlaurent/heroku-buildpack-java.git
with a pom.xml slighty changed from the heroku java tutorial to (we just wrapped the maven dep copy within a profile) :
running mvn clean install outside heroku is speedy as the copy dep is skipped, and it still is activated when run from heroku.