sbin/sync/sync_hdalab
changeset 136 78e72cc505b9
child 145 5e79ea1eccb3
equal deleted inserted replaced
135:dd6578e36a57 136:78e72cc505b9
       
     1 #!/usr/bin/env bash
       
     2 set -e
       
     3 if [ -d ~/tmp/hdalab_V$1 ]; then
       
     4     rm -fr ~/tmp/hdalab_V$1;
       
     5 fi
       
     6 
       
     7 hg archive -r V$1 ~/tmp/hdalab_V$1
       
     8 
       
     9 #text2unix ~/tmp/hdalab_V$1
       
    10 
       
    11 if [ -d ~/tmp/hdalab_V$1 ]; then
       
    12     cat <<EOT | rsync -Cvrlz --delete --filter=". -" ~/tmp/hdalab_V$1/web/ iri@web.iri.centrepompidou.fr:/iridata/www/iri-research/hdalab/
       
    13 + core
       
    14 P .htpasswd
       
    15 P hdalab/config.py
       
    16 P robots.txt
       
    17 P env/***
       
    18 P log/***
       
    19 P index/***
       
    20 P static/media/***
       
    21 EOT
       
    22 fi
       
    23 
       
    24 if [ -d ~/tmp/hdalab_V$1 ]; then
       
    25     echo "Deleting temp export"
       
    26     rm -fr ~/tmp/hdalab_V$1;
       
    27 fi
       
    28 
       
    29 ssh iri@web.iri.centrepompidou.fr "export PYTHONPATH=/iridata/www/iri-research/hdalab && source /srv/virtualenv/hdalab/bin/activate && cd /iridata/www/iri-research/hdalab/hdalab && django-admin.py collectstatic --noinput"
       
    30 ssh iri@web.iri.centrepompidou.fr sudo apache2ctl restart