opensas/openshift — Issue #1: document job plan
Author: opensas
Created: 2011-11-09 15:14:27+00:00
State: open

manual steps to deploy to openshift

play rhc:deploy

play openshift:deploy

params:

-a|--app application
-l|--rhlogin rhlogin
-p|--password password
--timeout #
-d|--debug

-m --message, defaults to "deployed on 'yyyy-mm-dd'"

-s --subdomain application's subdomain, defaults to ROOT
-e --embed cartridges to add when creating app, phpmyadmin, mysql

prerequisitos:

git installed - git version

domain created

-a application
-l rhlogin
-p password

deploy():

1) check if is a play app
2) check if git is installed - git version
3) check_openshift_app()

4) check_local_repo() -- exclude openshift from local repo - or add a warning

5) generate_war()

7) deploy_war()

check_openshift_app()

looks for and openshift/app/.git folder
if it's there return ok

if exists openshift folder
error, openshift folder exists, delete it

mkdir openshift
cd openshift

rhc-user-info -p redsas -a
check app is not created
if app is created - git clone remote repo
git clone ....
else
check application contains non-alphanumeric characters!
in that case, show error, configure openshift.application in application.conf

rhc-create-app -t jbossas-7.0 -a

possible errors:
RESULT:
opensas@gmail.com has already reached the application limit of 5

cd -a
rm -fr src pom.xml

git add -A
git commit -m "remove useless app"
-- git push - not necessary, but desirable

cd ..
cd ..

check_local_repo()
if there's a local repo add a warning telling to add /openshift to .ignore file, if not already there

generate_war()
check deployments folder
generate ROOT.war (check param -s)
echo `date` > openshift/app/deployments/ROOT.war.dodeploy
play war -o openshift/app/deployments/ROOT.war --exclude openshift

deploy_war() -m
cd openshift/app
git add deployments
git commit -m "deployed at `date`"
git push