-
Notifications
You must be signed in to change notification settings - Fork 627
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
automate building war files for pull requests #546
Comments
Getting close following this https://devcenter.heroku.com/articles/java-webapp-runner see https://github.com/inodb/cbioportal/tree/heroku But when I run the following:
I get this error, any clue?
|
Managed to fix this issue with a lot of help from Heroku's @jkutner. The code is on my heroku branch: https://github.com/inodb/cbioportal/tree/heroku. See an example here of a deployed PR: There are some costs involved that are worth discussing:
|
Heroku has a free MySQL add-on, but it's limited to 10 connections, and 5MB of data. I'm not sure what your db requirements are, though. The review apps actually create a new app. You can have one free dyno per app and each app can have it's own free DB. The only limitation is that an unverified account (i.e. one without a credit card attached) can only have 5 apps at a time. But since these apps are created on-demand from PRs, you just have to throttle how many things you are working on at once :) I hope that helps. Let me know if you have any more questions. |
Thanks for the comments, @jkutner. The mysql db at the moment is ~10GB. We might be able to shrink it down a bit in the future but not soon. I didn't realize that each PR would spin up as a separate app. That's great! |
- Add webapp-runner.jar as dependency (used by heroku to run war) - Add deploy to heroku button to README - Remove unnecessary target directories after building war to decrease heroku's slug size (basically size repo + war) - Add dbconnector spring property to allow using jndi or dbcp at runtime. Heroku's webapp-runner.jar does not seem to work with our setup of jndi. - Add heroku specific property files (use amazon public db) - There was a problem with PORTAL_HOME both being required at run time and build time. At Heroku the build directory is different from the run directory and currently there is no dynamic way to get the name of this dir. Scripts in profile.d are run on heroku before the war is started. This allows one to set the PORTAL_HOME variable there. The PORTAL_HOME variable at build time is set through a buildpack on github inodb/cbioportal-buildpack. This is why the extra buildpack is required. - There is a heroku profile in pom.xml that copies all heroku specific files to the root dir of the portal when building the war. Only app.json has to be in the root dir for the deploy to heroku button to work.
- Add webapp-runner.jar as dependency (used by heroku to run war) - Add deploy to heroku button to README - Remove unnecessary target directories after building war to decrease heroku's slug size (basically size repo + war) - Add dbconnector spring property to allow using jndi or dbcp at runtime. Heroku's webapp-runner.jar does not seem to work with our setup of jndi. - There is a heroku profile in pom.xml that copies all heroku specific files to the root dir of the portal when building the war. Only app.json has to be in the root dir for the deploy to heroku button to work. Copy EXAMPLE property file to src/main/resources/portal.properties. Set custom properties on command line with maven in app.json (i.e. use amazon public db). - There was a problem with PORTAL_HOME both being required at run time and build time. At Heroku the build directory is different from the run directory and currently there is no dynamic way to get the name of this dir. Scripts in profile.d are run on heroku before the war is started. This allows one to set the PORTAL_HOME variable there. The PORTAL_HOME variable at build time is set through a buildpack on github inodb/cbioportal-buildpack. This is why the extra buildpack is required.
@jkutner One more question. It seems to work really well so far. Only problem with automatically creating apps for each PR is that when we click the checkbox there is a message that there is no |
@inodb do you have an There are some peculiar caveats with Heroku Button from a branch, and those may affect review apps in some way too. I think if you remove this from the "repository":"https://github.com/cbioportal/cbioportal", |
Thanks @jkutner. I've tried removing the |
@inodb ah, so it seems the validation when clicking the checkbox is just a safe guard, and may not actually have any effect on the behavior. I will check with the folks who own that feature to confirm. |
\o/ nice! the button worked for me. it looks like its pushing the memory limits a bit, though. i'll see what i can do about that. |
Deploy to OpenShift:
https://blog.openshift.com/how-to-build-and-deploy-openshift-java-projects-using-travis-ci/
Deploy to Heroku:
https://blog.travis-ci.com/2013-07-09-introducing-continuous-deployment-to-heroku/
You can also deploy Java Applications with the Heroku Maven Plugin:
https://devcenter.heroku.com/articles/deploying-java-applications-with-the-heroku-maven-plugin
The text was updated successfully, but these errors were encountered: