Created
July 12, 2012 15:19
-
-
Save claudiosf/3098819 to your computer and use it in GitHub Desktop.
Assembly-p deploy script
This file contains hidden or 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 | |
# Escenic deploy script | |
# Version: 2.0 | |
if [ -z "$1" ] | |
then | |
echo "Publication not defined." | |
echo "USAGE:$0 <publication-name>" | |
exit | |
fi | |
echo "ESCENIC DEPLOY SCRIPT 2.0" | |
SRC="/home/claudio/workspace/iweb/2_src" | |
toCompile[0]="libraries/iweb-core" | |
toCompile[1]="impresa_widgets/widget-framework-core" | |
#toCompile[2]="impresa_widgets/impresa-widget-core" | |
#toCompile[0]="impresa_widgets/widget-impresa-cardapio" | |
#toCompile[4]="impresa_widgets/widget-impresa-google-search" | |
#toCompile[5]="impresa_widgets/widget-impresa-multimediaBrowser" | |
#toCompile[1]="impresa_widgets" | |
toCompile[2]="impresa_widgets/widget-impresa-listagem" | |
echo "-> Compiling ${#toCompile[@]} sources ..." | |
for i in $(seq 0 $((${#toCompile[@]} - 1))) | |
do | |
echo "--> Compiling ${toCompile[$i]} ..." | |
cd $SRC/${toCompile[$i]} | |
mvn clean install | |
RETVAL=$? | |
if [ $RETVAL -ne 0 ] | |
then | |
exit | |
fi | |
done | |
echo "-> Processing publications ..." | |
for i in "$@" | |
do | |
echo "--> Installing ${i} ..." | |
cd $SRC/publications/${i} | |
mvn clean install | |
RETVAL=$? | |
if [ $RETVAL -ne 0 ] | |
then | |
exit | |
fi | |
echo "--> Sending ${i}.war to assembly-p ..." | |
cd $SRC/publications/${i}/dist | |
scp ${i}.war escenic@assembly-p:publications | |
done | |
echo -n "Start assembly-p deploy procedure(y/N)?" | |
read -e START_DEPLOY | |
if [ $START_DEPLOY == "y" ] | |
then | |
echo "Starting deploy procedure on assembly-p for $@..." | |
ssh -n escenic@assembly-p './deploy.sh && ece start' | |
echo "Done. Now just wait for the seasons to change!!!" | |
fi | |
echo "$(date +%Y-%m-%d_%H:%M) [ DONE ]" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment