diff --git a/TODO b/TODO new file mode 100644 index 0000000..0422413 --- /dev/null +++ b/TODO @@ -0,0 +1,3 @@ +- Clean old deployment on remote servers +- Git support +- Amazon S3/CloudFront support for static files diff --git a/evolistrano.conf b/evolistrano.conf index e240ba3..14eeb3c 100644 --- a/evolistrano.conf +++ b/evolistrano.conf @@ -12,7 +12,7 @@ subdocroot="/srv/www" excludelist="--exclude global.ini --exclude database.ini --exclude config.ini" # Static (CSS/JS/IMG/etc.) list -# TODO: Gerer Amazon S3/CloudFront +# TODO: Amazon S3/CloudFront support staticlist="static00.example.com static01.example.com" # SSH key @@ -49,3 +49,4 @@ staticfilesdir="static" # email address for notification (empty if no notification) mailnotif="" + diff --git a/evolistrano.sh b/evolistrano.sh index be884a5..38ebc6d 100755 --- a/evolistrano.sh +++ b/evolistrano.sh @@ -94,11 +94,11 @@ echo #set +e +local_space=`du -sm $dir_export/ | sed 's/^\([0-9]\+\)\t.*$/\1/'` # Deploy on WWW servers for remote in $wwwlist; do # Be sure to have space for deploying - local_space=`du -sm $dir_export/ | sed 's/^\([0-9]\+\)\t.*$/\1/'` remote_space=`ssh -p $sshport -o UserKnownHostsFile=$full_path/known_hosts -i $full_path/$sshkey $sshuser@$remote df -lPm $subdocroot | grep ^/ | tr -s " " | cut -d" " -f4` if [ $local_space -ge $remote_space ]; then echo "WARNING... $remote has only $remote_space Mo while you want upload $local_space Mo. Do you want stop ? [y/N]"; read_confirm; fi @@ -123,12 +123,11 @@ for remote in $wwwlist; do done +local_space=`du -sm $dir_export/$staticfilesdir | sed 's/^\([0-9]\+\)\t.*$/\1/'` for remote in $staticlist; do - #TODO: calculer la taille de la destination (df $subdocroot) && pas de deploiement si cela depasse !! # Be sure to have space for deploying - local_space=`du -sm $dir_export/www/static/ | sed 's/^\([0-9]\+\)\t.*$/\1/'` - remote_space=`ssh -p $sshport -o UserKnownHostsFile=$full_path/known_hosts -i $full_path/$sshkey $sshuser@$remote df -lPm /var/www/$staticdestdir | grep ^/ | tr -s " " | cut -d" " -f4` + remote_space=`ssh -p $sshport -o UserKnownHostsFile=$full_path/known_hosts -i $full_path/$sshkey $sshuser@$remote df -lPm $subdocroot | grep ^/ | tr -s " " | cut -d" " -f4` if [ $local_s -ge $remote_s ]; then echo "WARNING... $remote has only $remote_s Mo while you want upload $local_s Mo : stop deploy now with Ctrl+C"; read enter; fi echo "sending static on $remote"