weblate/ci/run-migrate
Michal Čihař da377339cc Test migration as described by upgrading docs
Signed-off-by: Michal Čihař <michal@cihar.com>
2018-05-30 10:40:23 +02:00

31 lines
872 B
Bash
Executable file
Vendored

#!/bin/sh
# Migrations test executor
. ci/lib
TAGS="weblate-2.16 weblate-2.17.1 weblate-2.18 weblate-2.19 weblate-2.19.1 weblate-2.20"
for tag in $TAGS ; do
rm weblate.db
git checkout $tag
run_coverage ./manage.py migrate
check
git checkout $TRAVIS_COMMIT
sed -i 's/^AUTH_USER_MODEL/#AUTH_USER_MODEL/' weblate/settings_example.py
run_coverage ./manage.py migrate weblate_auth 0001
sed -i 's/^#AUTH_USER_MODEL/AUTH_USER_MODEL/' weblate/settings_example.py
run_coverage ./manage.py migrate
check
done
./manage.py makemigrations
check
if [ `git status -s | grep -c /migrations/` -gt 0 ] ; then
echo 'There are untracked migrations:'
git status -s --porcelain grep /migrations/ | sed -n '/^??/ s/^?? \(.*\)/\1/p' | while read migration ; do
echo $migration
cat $migration
echo
done
exit 1
fi