diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index d44efe516fb40c073fe4e18d7ae6baa00460c1f8..3bf923f3e82095d5184f4131e4dcd725dd847262 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -26,10 +26,9 @@ cache: - pip install pylint-gitlab pylint-django - mysql --version -check: +migrations: extends: .before_script_template script: - - ./Utils/check.sh --all - source venv/bin/activate - ./manage.py makemigrations --dry-run --check diff --git a/Utils/check.sh b/Utils/check.sh index c2e09f5b8852b9a2e70b9c9f6f9e1296c1404f02..a8a9d4b7a9d6e78e7d93cabecb6bd4f36af4f89f 100755 --- a/Utils/check.sh +++ b/Utils/check.sh @@ -8,14 +8,21 @@ if [ -z ${VIRTUAL_ENV+x} ]; then fi # enable really all warnings, some of them are silenced by default -if [[ "$@" == *"--all"* ]]; then - export PYTHONWARNINGS=all -fi +for arg in "$@"; do + if [[ "$arg" == "--all" ]]; then + export PYTHONWARNINGS=all + fi +done # in case of checking production setup -if [[ "$@" == *"--prod"* ]]; then - export DJANGO_SETTINGS_MODULE=AKPlanning.settings_production - ./manage.py check --deploy -fi +for arg in "$@"; do + if [[ "$arg" == "--prod" ]]; then + export DJANGO_SETTINGS_MODULE=AKPlanning.settings_production + ./manage.py check --deploy + ./manage.py makemigrations --dry-run --check + fi +done +# check the setup ./manage.py check +./manage.py makemigrations --dry-run --check diff --git a/Utils/test.sh b/Utils/test.sh index 74fe4928452be87e22f465365a30b5c00716dc05..ab6dbb2b9f23f3427b773715c5fa4ba1d74c179e 100644 --- a/Utils/test.sh +++ b/Utils/test.sh @@ -8,14 +8,19 @@ if [ -z ${VIRTUAL_ENV+x} ]; then fi # enable really all warnings, some of them are silenced by default -if [[ "$@" == *"--all"* ]]; then - export PYTHONWARNINGS=all -fi +for arg in "$@"; do + if [[ "$arg" == "--all" ]]; then + export PYTHONWARNINGS=all + fi +done -# in case of testing production setup -if [[ "$@" == *"--prod"* ]]; then - export DJANGO_SETTINGS_MODULE=AKPlanning.settings_production - ./manage.py test --deploy -fi +# in case of checking production setup +for arg in "$@"; do + if [[ "$arg" == "--prod" ]]; then + export DJANGO_SETTINGS_MODULE=AKPlanning.settings_production + ./manage.py test --deploy + fi +done +# run tests ./manage.py test