Just a simple guide on how to get started on deploying a Grails app up to Openshift.
The prerequisites to get started, we need two things being Git and the Openshift RHC tool.
Guide on how to install them in different OS platforms are available here.
This is only a simple static website developed using Grails. This guide is based off on
Step 1:
Don't bother creating the free app on the Openshift application console. Instead we're gonna use the Openshift RHC command line tool and create the free app. Do this in your user directory:
rhc create-app appname tomcat-7
This will create a gear that is assumed to be Jboss EWS 2.0, but it's not.
Anyways, assuming that you're not doing any data storing functionality on the Grails app, tomcat-7 is what you need.
So let everything being taken cared of for you, and a repo will be cloned based on the appname that you've put.
Step 2:
Generate a war file out of your Grails project by using this command
grails war
Rename the war file generated from Grails to ROOT.war and dump it into appname/webapp folder.
Step 3:
Inside the cloned appname folder, open up
Inside the cloned appname folder, open up
.openshift/config/servers.xml
set unpackWars to true
Step 5:
Delete pom.xml file somewhere in the src folder within the appname folder.
Step 5:
Delete pom.xml file somewhere in the src folder within the appname folder.
Step 6:
In the appname git root folder directory
git add .
git commit -am 'first commit'
git push
Step 7:
Sit back, relax and drink beer. (Kidding...)
Wait for a while because it's gonna need a few minutes for the deployment to take effect.
Comments
Post a Comment