Skip to content

Latest commit

 

History

History
45 lines (27 loc) · 1.74 KB

OpenshiftDeployment.md

File metadata and controls

45 lines (27 loc) · 1.74 KB

Deploying on Openshift

Register for openshift account and create a tomcat 7 app with mysql support. Execute the following command in a newly-created directory (e.g. statealerts-deployment)

rhc app create -a statealerts jbossews-2.0 mysql-5.1

Clone the openshift git repo:

git clone <your repo>

Delete the src folder and pom.xml file from the template

cd statealerts
git rm -r src/ pom.xml

Copy the prebuid war into webapps folder as ROOT.war

cp <path-to-source>/webapp/target/statealerts-0.0.1-SNAPSHOT.war webapps/ROOT.war

In .openshift/config/server.xml find Connector element and add URIEncoding="utf-8" attribbute so it looks like

<Connector address="${OPENSHIFT_JBOSSEWS_IP}"
           port="${OPENSHIFT_JBOSSEWS_HTTP_PORT}"
           protocol="HTTP/1.1"
           connectionTimeout="20000"
           URIEncoding="utf-8"
           redirectPort="8443"/>

In .openshift/action_hooks folder create a file called pre_start_jbossews with following contents

export CATALINA_OPTS="-Dstatealerts.config.location=${OPENSHIFT_REPO_DIR}/config -Duser.timezone=UTC"

In repository root folder create folder called config and copy there all files from project-root/config (at least the following configuration files statealert.properties, extractors.json, ehcache.xml)

Commit your changes

git add webapps config .openshift
git commit  -m "Inital commit for state alerts app."

To deploy the application execute

git push

Note: If the disk space on the server is over, you have to clean the git repo. Follow these steps to do so: https://www.openshift.com/forums/openshift/how-to-erase-all-history-from-a-git-repository-on-openshift-and-start-over-with