update deploy script

This commit is contained in:
Thibault Duplessis 2013-05-29 09:25:39 +02:00
parent 75e37f879b
commit 62ab267d00

View file

@ -10,13 +10,13 @@ if [ -z $1 ]; then
fail fail
elif [ $1 = "main" ]; then elif [ $1 = "main" ]; then
REMOTE="hollie" REMOTE="hollie"
REMOTE_DIR="/home/lila" REMOTE_DIR="/home/lila4"
elif [ $1 = "ai" ]; then elif [ $1 = "ai" ]; then
REMOTE="cook" REMOTE="cook"
REMOTE_DIR="/home/lila" REMOTE_DIR="/home/lila4"
elif [ $1 = "local" ]; then elif [ $1 = "local" ]; then
REMOTE="localhost" REMOTE="localhost"
REMOTE_DIR="/tmp/" REMOTE_DIR="/tmp/lila4"
else else
fail fail
fi fi
@ -27,19 +27,11 @@ APP_NAME=lila-4.0
bin/closure bin/closure
bin/play dist bin/play compile stage
if [ $? != 0 ]; then if [ $? != 0 ]; then
lilalog "Deploy canceled" lilalog "Deploy canceled"
exit 1 exit 1
fi fi
cd dist
rm -rf $APP_NAME
unzip $APP_NAME.zip
chmod +x $APP_NAME/start
cd ..
echo "NOT deploying"
exit 1
RSYNC_OPTIONS=" \ RSYNC_OPTIONS=" \
--archive \ --archive \
@ -48,16 +40,16 @@ RSYNC_OPTIONS=" \
--progress \ --progress \
--compress \ --compress \
--checksum \ --checksum \
--exclude local.conf \ --exclude application.conf \
--exclude logs \ --exclude logs \
--exclude RUNNING_PID \ --exclude RUNNING_PID \
--exclude bin/.translate_version"; --exclude bin/.translate_version";
lilalog "Rsync scripts, binaries and assets" lilalog "Rsync scripts, binaries and assets"
rsync $RSYNC_OPTIONS bin dist/$APP_NAME/* public $REMOTE:$REMOTE_DIR rsync $RSYNC_OPTIONS bin target public $REMOTE:$REMOTE_DIR
lilalog "Restart lila" lilalog "Restart lila4"
ssh $REMOTE "service lila restart" ssh $REMOTE "service lila4 restart"
lilalog "Deploy complete" lilalog "Deploy complete"