From 210f9deb9b5888d787d26ee97ab045550aa49b51 Mon Sep 17 00:00:00 2001 From: Nadja Geisler <ngeisler@fachschaft.informatik.tu-darmstadt.de> Date: Mon, 3 Mar 2025 21:23:19 +0000 Subject: [PATCH] remove redundant systems check from pipeline --- .gitlab-ci.yml | 3 +-- Utils/check.sh | 21 ++++++++++++++------- Utils/test.sh | 21 +++++++++++++-------- 3 files changed, 28 insertions(+), 17 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index d44efe51..3bf923f3 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 c2e09f5b..a8a9d4b7 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 74fe4928..ab6dbb2b 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 -- GitLab