Commit ee52a71d authored by Giuseppe Terrasi's avatar Giuseppe Terrasi

parents 48f966c4 4303f48a
#!/bin/sh #!/bin/sh
PYTHONPATH=/path/to/dir_above_osqa_site PYTHONPATH=/srv/www/chiedi.ubuntu-it.org/www
export PYTHONPATH export PYTHONPATH
PROJECT_ROOT=$PYTHONPATH/osqa_site PROJECT_ROOT=$PYTHONPATH/osqa
/path/to/python $PROJECT_ROOT/manage.py send_email_alerts /usr/bin/python $PROJECT_ROOT/manage.py send_email_alerts
WEB=/srv/chiedi.ubuntu-it.org
WWW=$WEB/www/osqa/
BZR=/srv/shared-branches/ubuntu-it-ask
BZRWWW=$BZR/ubuntu-it-ask/
function update_files {
##Copy of all files
cp -ax $BZRWWW/* $WWW/
}
############################################
## Test if repo has been updated ##
############################################
TMP_FILE=/tmp/wwwrepo_version ## Temp file where version bzr repo was saved
## Create temp file if it doesn't exist
if ! test -f $TMP_FILE ; then
cat /dev/null > $TMP_FILE
fi
cd $BZR
VERSION=`cat $TMP_FILE`
VERSION_TEST=`bzr up 2>&1 | tail -n1 `
if [ ! "$VERSION_TEST" = "$VERSION" ] ; then
echo "$VERSION_TEST" > $TMP_FILE
update_files
fi
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment