In a previous blog post I wrote about how to setup a DIY cartridge on OpenShift2 when you need Java 8 for a Spring-Boot application. What I actually didn’t like in that solution was the fact that the installed JDK uses several hundred megabytes of disk space. When running in the free plan on a small gear this is too much when you add a cartridge like mongo which itself uses over 400MB.
When a Spring-Boot application is deployed on OpenShift, it can be reached both with a HTTP URL and a HTTPS URL. This is because OpenShift runs a proxy in front of the application which in case of HTTP just routes the request to the application. If a request comes in via HTTPS, the proxy does all the encryption handling with the client and then passes the decrypted request on to the application – on the HTTP channel – and encrypts the response before sending it to the client.
Note to self: this is a copy from the OpenShift documentation:
Configuring Which Branch to Deploy
By default OpenShift deploys the master branch when you do a git push (when automatic deployments are enabled). You can change this behavior using the rhc app-configure –deployment-branch command, where is the new branch to deploy.
$ rhc app-configure --deployment-branch # Master is the Default $ rhc app-configure myapp --deployment-branch new_branch Configuring application 'myapp' .
This post describes how to create and deploy a Spring-Boot application to RedHat OpenShift (version 2) when the application is using Java 8.
Edit 2015-10-04: In this newer post I show how to not install a custom JDK. So you should first read this post and then the linked one for additional information.
Normally deploying a Spring-Boot application on OpenShift is not too much pain and is explained in the Spring-Boot documentation.