Synchro
This commit is contained in:
parent
56b40a7b6c
commit
be46271d49
19
synchro.sh
19
synchro.sh
@ -2,8 +2,11 @@
|
||||
|
||||
clear
|
||||
|
||||
## NO MORE DB UPDATES ON THE PREPROD ##
|
||||
ONLYPULL=1
|
||||
|
||||
echo "Start Sync"
|
||||
|
||||
if [ $ONLYPULL -eq 0 ]; then
|
||||
#Dump local database
|
||||
echo "Exporting the local Database"
|
||||
mysqldump -h 192.168.0.41 -u root chocolatdemariage > chocolatdemariage.sql
|
||||
@ -25,4 +28,16 @@ ssh root@chocolatdemariage.preprod.antadis.fr -p4096 "cd /home/www/chocolatdemar
|
||||
&& mkdir -p /home/www/chocolatdemariage.preprod.antadis.fr/www/{log,upload} \\
|
||||
&& chown -R www-data:www-data www/* \\
|
||||
"
|
||||
printf "Sync complete !! \n"
|
||||
else
|
||||
ssh root@chocolatdemariage.preprod.antadis.fr -p4096 "cd /home/www/chocolatdemariage.preprod.antadis.fr \\
|
||||
&& git pull origin master \\
|
||||
&& if [ -f /home/www/chocolatdemariage.preprod.antadis.fr/www/cache/class_index.php ] ; then rm /home/www/chocolatdemariage.preprod.antadis.fr/www/cache/class_index.php ; fi \\
|
||||
&& mkdir -p /home/www/chocolatdemariage.preprod.antadis.fr/www/{log,upload} \\
|
||||
&& chown -R www-data:www-data www/* \\
|
||||
"
|
||||
fi
|
||||
|
||||
echo "Sync complete !!"
|
||||
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user