How to redeploy a Tomcat 7 application on Openshift
Asked Answered
B

3

7

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?

Burch answered 10/5, 2013 at 10:40 Comment(3)
git push origin master -f ?Goosy
It doesn't work. I think ``` git push --force``` is used to overwrite the source code on repo which is not an ancestor of the local ref.Burch
@rAy: That's correct, and OpenShift only triggers deploy if a different commit is pushed then the one that's already there.Wherefore
D
8

You can run

rhc app deploy HEAD -a <appname>

if you're using the command line tools

Detroit answered 9/3, 2014 at 8:17 Comment(0)
A
4

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
Amphimixis answered 17/9, 2013 at 5:49 Comment(2)
Your link is dead now. Is this similar to what you linked to originally? openshift.com/developers/remote-accessWaybill
I think 'gear' is the appropriate binary to run now instead. So the steps could be 'rhc ssh -a <app_name' followed by 'gear deploy'Ritzy
E
1

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).

Explicable answered 13/5, 2013 at 14:0 Comment(1)
I think this is actually the correct answer to the OP's question. +1Detroit

© 2022 - 2024 — McMap. All rights reserved.