| 1 | This bash script can be used to test new versions for a Django release. Provides a minimal sanity check on the tarball and wheel artifacts. |
| 2 | {{{#!bash |
| 3 | #! /bin/bash |
| 4 | |
| 5 | set -xue |
| 6 | |
| 7 | cd /tmp |
| 8 | |
| 9 | RELEASE_VERSION="${RELEASE_VERSION}" |
| 10 | if [[ -z "$RELEASE_VERSION" ]]; then |
| 11 | echo "Please set RELEASE_VERSION as env var" |
| 12 | exit 1 |
| 13 | fi |
| 14 | |
| 15 | MAJOR_VERSION=`echo $RELEASE_VERSION| cut -c 1-3` |
| 16 | PKG_TAR="https://www.djangoproject.com/m/releases/$MAJOR_VERSION/Django-$RELEASE_VERSION.tar.gz" |
| 17 | PKG_WHL="https://www.djangoproject.com/m/releases/$MAJOR_VERSION/Django-$RELEASE_VERSION-py3-none-any.whl" |
| 18 | |
| 19 | python3 -m venv django-pip |
| 20 | . django-pip/bin/activate |
| 21 | python -m pip install $PKG_TAR |
| 22 | django-admin startproject test_one |
| 23 | cd test_one |
| 24 | ./manage.py --help # Ensure executable bits |
| 25 | python manage.py migrate |
| 26 | python manage.py runserver |
| 27 | |
| 28 | deactivate |
| 29 | cd .. |
| 30 | rm -rf test_one |
| 31 | rm -rf django-pip |
| 32 | |
| 33 | |
| 34 | python3 -m venv django-pip-wheel |
| 35 | . django-pip-wheel/bin/activate |
| 36 | python -m pip install $PKG_WHL |
| 37 | django-admin startproject test_one |
| 38 | cd test_one |
| 39 | ./manage.py --help # Ensure executable bits |
| 40 | python manage.py migrate |
| 41 | python manage.py runserver |
| 42 | |
| 43 | deactivate |
| 44 | cd .. |
| 45 | rm -rf test_one |
| 46 | rm -rf django-pip-wheel |
| 47 | }}} |