Andrew
Andrew

Reputation: 2823

OpenShift binary deployment, tar.gz structure

I am trying to deploy a *.war file to OpenShift.

After looking at OpenShift documentation, I found a way to deploy binaries to OpenSHift:

rhc deploy path_to_binary -a application_name

However, deploying a simple *.war file fails with the following message:
Error message: Unable to extract deployment archive using command: /bin/tar -xz
It looks like OpenShift requires the binary to be packaged as a tar.gz archive.

So, my question is:
What is the structure of the *.tar.gz, which I can deploy to OpenShift?
Strange, but I was not able to find this info in the documentation.

Upvotes: 2

Views: 1391

Answers (2)

ncdc
ncdc

Reputation: 351

For a jbossas application, create a tar.gz file with the following contents:

build_dependencies/ (empty directory)
dependencies/jbossas/deployments/ROOT.war
repo/ (empty directory, or you can include .openshift/... if you need hooks or markers)

or for jbosseap:

build_dependencies/ (empty directory)
dependencies/jbosseap/deployments/ROOT.war
repo/ (empty directory, or you can include .openshift/... if you need hooks or markers)

or for jbossews:

build_dependencies/ (empty directory)
dependencies/jbossews/webapps/ROOT.war
repo/ (empty directory, or you can include .openshift/... if you need hooks or markers)

Upvotes: 5

user2012519
user2012519

Reputation: 49

If you want to deploy your WAR file (that you build locally) to Open Shift here are the steps.

  1. Open Shift relies on GIT as part of its workflow. To short circuit this, you need to remove the build dependency. So first clone your remove code base environment by issuing the git clone command.
  2. Remove the 'src' directory and also the 'pom.xml' file from the cloned directory
  3. Next commit your changes and deletions by issuing git commit -am "i deleted stuff"
  4. Also do a git push to deploy changes to your gear.
  5. Using either SCP or SFTP upload your WAR file to the appropriate directory. For Tomcat, it is something like app-root/dependencies/jbossews/webapps
  6. Run rhc tail $appname to look at the log that your webapp was deployed
  7. Your app should run under: your-app-domain.rhcloud.com/yourApp

  8. To delete/undeploy your app, just SSH into your account and delete the file.

Upvotes: 2

Related Questions