Skip to content

Instantly share code, notes, and snippets.

@claudiosf
Created July 12, 2012 15:19
Show Gist options
  • Save claudiosf/3098819 to your computer and use it in GitHub Desktop.
Save claudiosf/3098819 to your computer and use it in GitHub Desktop.
Assembly-p deploy script
#!/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