Skip to main content

Grails Deployment on Openshift

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
.openshift/config/servers.xml

set unpackWars to true

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

Popular posts from this blog

Setting Up Android CheckStyle in Android Studio

So we all want to abide by the Android Code Style Guidelines shown in the official Android developer website here . How do we get started by helping ourselves by abiding by the Java and Android code style rules? Simple. Set it in Android Studio with the instructions below:  1. Copy the file in  https://github.com/android/platform_development/blob/master/ide/intellij/codestyles/AndroidStyle.xml 2. Paste the file into ~/.AndroidStudioPreview/config/codestyles/ (in Ubuntu) or ~/Library/Preferences/AndroidStudioPreview/codestyles (in Mac OS X) 3. Go to Settings (or Preferences in Mac OS X) > Code Style > Java, select AndroidStyle, as well as Code Style > XML and select AndroidStyle. 4. Start code inspection and see the results by selecting Analyze > Inspect Code. You will see the results of inspection on the Inspection pane at the bottom and and you will notice things that you can improve in your Java code such as Code Style Issues, Android, D

How To Reset Android Studio on Mac

Just in case you guys have trouble starting Android Studio for some unknown reason such as clearing the Mac OS cache using a third party tool, these are the steps to troubleshoot the problem. Step 1: Close Android Studio. Step 2: Remove all the directories that are related to Android Studio ~/Library/Application Support/AndroidStudioBeta ~/Library/Caches/ AndroidStudioBeta ~/Library/Logs/ AndroidStudioBeta ~/Library/Preferences/ AndroidStudioBeta Step 3: Start Android Studio Simple as that...

Install Git Bash Completion on Mac OS X

Bash completion for Git isn't available by default on the Mac's Terminal. So you have to assign it yourself in the environment path setup. By default your git directory should be at /usr/local/git in Mac. Assuming you're at your user directory: Step 1: sudo nano .bash_profile Step 2: add the line  source /usr/local/git/contrib/completion/git-completion.bash Ctrl+X to save, Ctrl+Y to save file name. Step 3: source .bash_profile Logout and Login again.