2013-05-07 13:52:38 -04:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
# Do not use this script, it was intended to be used for v2
|
|
|
|
# It's there until things evolve
|
|
|
|
|
|
|
|
exit 1
|
|
|
|
|
|
|
|
DEBUG=false
|
|
|
|
SCRIPT_NAME=`basename $0`
|
|
|
|
TEST_PATH="/home/hosted/pouet/sites/new.pouet.net"
|
|
|
|
RSYNC="rsync --recursive \
|
|
|
|
--delete \
|
|
|
|
--progress \
|
|
|
|
--checksum \
|
|
|
|
--links\
|
2013-05-11 14:47:22 -04:00
|
|
|
--keep-dirlinks \
|
2013-05-11 14:39:06 -04:00
|
|
|
--exclude=avatars \
|
|
|
|
--exclude=gfx/logos \
|
|
|
|
--exclude=nfo \
|
|
|
|
--exclude=othernfo \
|
|
|
|
--exclude=results \
|
|
|
|
--exclude=screenshots \
|
2013-05-07 13:52:38 -04:00
|
|
|
--exclude=rulez/*.log \
|
|
|
|
--exclude=include/auth.php \
|
|
|
|
--exclude=LAST_SCENEORG_CHECK \
|
|
|
|
--exclude=.git"
|
|
|
|
|
|
|
|
if $DEBUG
|
|
|
|
then
|
|
|
|
RSYNC="$RSYNC --dry-run"
|
|
|
|
fi
|
|
|
|
|
|
|
|
function usage()
|
|
|
|
{
|
|
|
|
echo "Usage: $SCRIPT_NAME <push|pull>"
|
|
|
|
echo " - $SCRIPT_NAME push : Push local version to new.pouet.net"
|
|
|
|
echo " - $SCRIPT_NAME pull : Pull new.pouet.net locally"
|
|
|
|
exit 1
|
|
|
|
}
|
|
|
|
|
|
|
|
copy_cache_from_live_to_test()
|
|
|
|
{
|
|
|
|
ssh pouet cp $LIVE_PATH/include/*.inc $TEST_PATH/include/
|
|
|
|
ssh pouet cp $LIVE_PATH/include/auth.php $TEST_PATH/include/auth.php
|
|
|
|
}
|
|
|
|
|
|
|
|
function push()
|
|
|
|
{
|
|
|
|
$RSYNC ./ pouet:$TEST_PATH
|
|
|
|
# copy_cache_from_live_to_test
|
|
|
|
}
|
|
|
|
|
|
|
|
function pull()
|
|
|
|
{
|
|
|
|
$RSYNC pouet:$TEST_PATH/ .
|
|
|
|
}
|
|
|
|
|
|
|
|
if [ ! -f .git/index ]
|
|
|
|
then
|
|
|
|
echo "Error: launch $SCRIPT_NAME at the root of the source folder pls oh pls"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
case "$1" in
|
|
|
|
push) push ;;
|
|
|
|
pull) pull ;;
|
|
|
|
*) usage;;
|
|
|
|
esac
|