Created
June 16, 2011 07:12
-
-
Save iamkristian/1028818 to your computer and use it in GitHub Desktop.
How to deploy to oc4j with continuous integration tools - like hudson
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
ROOTDIR=. | |
if [[ $1 = "hudson" ]] ; then | |
ROOTDIR="`pwd`/<ear-project-dir>" | |
else | |
ROOTDIR="." | |
fi | |
TARGET="$ROOTDIR/target" | |
ID="$ROOTDIR/src/main/cert/id_dsa" | |
USER=<username>@<hostname> | |
DEST=/tmp/ | |
INSTANCE=<instance> | |
DCMCTL=<path-to-oc4j-installation>/dcm/bin/dcmctl | |
UNDEPLOY="undeployApplication <applicationname> -co $INSTANCE" | |
RESTART="restart -co $INSTANCE" | |
DEPLOY="deployApplication -f \`ls /tmp/*.ear\` -a <applicationname> -co $INSTANCE" | |
if [[ -d $TARGET ]] ; then | |
echo "Deploying to $INSTANCE" | |
ssh -i $ID $USER "rm /tmp/*.ear" | |
scp -i $ID $TARGET/*.ear $USER:$DEST | |
ssh -i $ID $USER "$DCMCTL $UNDEPLOY" | |
ssh -i $ID $USER "$DCMCTL $DEPLOY" | |
echo "Done deploying" | |
else | |
echo "Nothing to deploy" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment