There are two options for deploying content to Tomcat Server in OpenShift. Both options can be used together (i.e. build one archive from the original and the other pre-built)
1) (Preferred). You can upload your content in the Maven src structure, as this is an example project and git push has an application built and deployed. To do this, you need your pom.xml to the root of your repository and the maven-war plugin, as in this example, to move the output from the assembly to the webapps directory. By default, warName is ROOT in pom.xml. This will result in webapp content that will be displayed at http://app_name-namespace.rhcloud.com/ . If you change warName in pom.xml to app_name, your base url will then become http://app_name-namespace.rhcloud.com/app_name .
Note. If you are building locally, you will also want to add any weekend wars under webapps from build to your .gitignore file.
Note. If you use scaled EWS2.0, you need the application to be deployed in the root context (i.e. http://app_name-namespace.rhcloud.com/ ) for the HAProxy load-balancer to recognize the instance of EWS2.0 is active.
or
2) You can git push pre-built wars in webapps /. To do this with the default repo, you first need to run 'git rm -r src / pom.xml' from the root of your repo.
The main workflows for deploying pre-created content (each operation will require the associated git add / commit / push operations):
A) Add new zipped content and deploy it:
- cp target / example.war webapps /
B) Undeploy the currently deployed content:
- git rm webapps / example.war
C) Replace the currently deployed zipped content with the new version and deploy it:
- cp target / example.war webapps /
Note. You can get the uri information above from running "show domain rhc"
If you have already made large files in your git repository, you rewrite or reset the history of these files in git to an earlier point in time, and then "git push -force" to apply these changes to the remote OpenShift server. git gc on a remote OpenShift repository can be forced (Note: tidy also performs other cleanups, including cleanup log files and tmp dirs):
rhc app tidy -a appname
If you choose option 1) or 2) the end result will be the application being deployed to the webapps directory. The webapps directory in Tomcat Distribution is the location that end users can place their deployment content (for example, war, ear, jar, sar files) to have it automatically deployed at server time.