Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to redeploy a Tomcat 7 application on Openshift

I know that a git push origin master will let Openshift redeploy the application to its new version.

But my situation is that my Tomcat application depends on another sub-module maven project, and they are both snapshot.

Once its sub-module project changes (the Tomcat application remains the same), the git push origin master doesn't work at all (Everything up-to-date) and of course Openshift will not redeploy my application, which means that it doesn't renew the newest sub-module snapshot artifact for me.

So, how to solve this problem? I have tried rhc restart and rhc reload, but they doesn't work. Is there some command like rhc redeploy?

like image 958
Wenhao Ji Avatar asked May 10 '13 10:05

Wenhao Ji


People also ask

Can we deploy WAR file in OpenShift?

war directly to OpenShift instead of relying on the platform to build your source code and resolve all of your dependencies for you (maven for example). I am happy to report that you can do this with just a few taps of the keys at your trusty command line using the oc command line tool.

How do I change the deployment path in Tomcat?

1- Custom Deploy Directory Follow the steps below to change the default deploy directory of Tomcat in Eclipse. Select “use custom location” radio button in the “Server Locations” section and set your custom deploy path.

Does OpenShift use Tomcat?

You now know how to install Tomcat on OpenShift, use Tomcat to deploy a web application to OpenShift, and access the Tomcat /manager page. I hope this tutorial helps you get started with your OpenShift explorations.


3 Answers

You can run

rhc app deploy HEAD -a <appname>

if you're using the command line tools

like image 171
Cameron Martin Avatar answered Sep 27 '22 23:09

Cameron Martin


You can start the deploy steps by ssh'ing to your openshift application. Check your ssh line from https://openshift.redhat.com/app/console/applications/ -> Click your application and then "Want to log in to your application?". Check https://www.openshift.com/developers/remote-access for detailed help (thanks RustyTheBoyRobot).

Once in, run:

gear deploy
like image 34
Juho Rutila Avatar answered Sep 27 '22 23:09

Juho Rutila


Are you sure that you've pulled and committed the most recent changes to the submodule? What's probably happening is the reference to the desired submodule commit isn't updated, so even though the submodule has changed, you project doesn't really know about it. I believe git submodule status should show you the commit your main project currently knows about.

To update this reference, follow these directions.

[main]$  cd ./subm
[subm]$  git pull origin/master   # or fetch then merge
[subm]$  cd ..
[main]$  git commit ./subm -m "Updated submodule reference"

If you actually committed changes in the last step, then OpenShift should update it appropriately (since this time, there were changes to the git repo).

like image 24
Fotios Avatar answered Sep 27 '22 23:09

Fotios