Persistent JBossAS7 Deployments on Openshift

When working with Openshift especially in cases where you have application type as jbossas-7 or jbosseap-6.0, there will be a need to have persistent deployments that will stand your git pushes.   By default your entire repository will be refreshed on each push and your applications under $APP/deployments will be deleted and redeployed.

Now comes the question how do I persist the deployments e.g. I am deploying a framework like Liferay Portal which I will rather don’t need to deploy each and every time when I build my application (avoid deployments during git push) ?

One of the solutions could be that we combine the option that Openshift gives, along with the power and flexibility that  of JBoss-AS7 offers.

Lets take an example that we want to deploy Liferay Portal on Openshift but we want to avoid the redeployment of the same on each git push from our local app repo to Openshift repo.   Here are the steps how I did accomplish the same,

  • Extract and explode Liferay Portal WAR in $OPENSHIFT_DATA_DIR in to a directory called liferay lets call it as $OPENSHIFT_LIFERAY_DEPLOY_DIR, as you know that anything within  $OPENSHIFT_DATA_DIR is persisted across pushes
  • Create a new deployment-scanner in you $REPO_DIR/standalone.xml which points to $OPENSHIFT_LIFERAY_DEPLOY_DIR created in the previous step, ideally it looks like                                                                                                             <deployment-scanner  name=”LiferayPortal” path=”liferay”   relative-to= ${env.OPENSHIFT_DATA_DIR}” scan-interval=”5000″ deployment-timeout=”700″/>
  • Do a git push now to push your standalone.xml changes to the 

Post the above steps you will see that the  JBoss-AS7 deployment scanner will deploy the liferay portal war from the $OPENSHIFT_LIFERAY_DEPLOY_DIR folder.

We can now concentrate only on the deployments of the Liferay Plugins and not the actual Liferay Portal every time you do a push to Openshift repo

A note of thanks to

Advertisements

1 Comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s