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?

timo.rieber
  • 3,727
  • 3
  • 32
  • 47
Wenhao Ji
  • 5,121
  • 7
  • 29
  • 40
  • `git push origin master -f` ? – eis May 10 '13 at 14:09
  • 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. – Wenhao Ji May 10 '13 at 14:40
  • @rAy: That's correct, and OpenShift only triggers deploy if a different commit is pushed then the one that's already there. – Flimm Feb 02 '16 at 16:29

3 Answers3

8

You can run

rhc app deploy HEAD -a <appname>

if you're using the command line tools

Cameron Martin
  • 5,952
  • 2
  • 40
  • 53
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
Juho Rutila
  • 2,316
  • 1
  • 25
  • 40
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).

Fotios
  • 3,643
  • 1
  • 28
  • 30