77 checkout scm
88
99 sh '''
10+ export PATH=/var/lib/jenkins/.local/bin:$PATH # needed for pdm
1011cd $WORKSPACE
1112git fetch --tags
12- rm -rf venv && python3 -m venv venv
13- . venv/bin/activate
14- pip3 install -r requirements_dev.txt
13+ pdm venv remove -y in-project || echo "No pdm venv so far, continuing"
14+ pdm sync --clean
1515cat <<ENDOFFILE > my.cnf
1616[client]
1717database = pytition
@@ -23,7 +23,7 @@ ENDOFFILE
2323echo "Generating a basic config file"
2424
2525echo "from .base import *" > pytition/pytition/settings/config.py
26- echo "SECRET_KEY = '$(python3 -c "from django.core.management.utils import get_random_secret_key as g; print(g())")'" >> pytition/pytition/settings/config.py
26+ echo "SECRET_KEY = '$(pdm run python3 -c "from django.core.management.utils import get_random_secret_key as g; print(g())")'" >> pytition/pytition/settings/config.py
2727cat <<EOT >> pytition/pytition/settings/config.py
2828DATABASES = {
2929 'default': {
@@ -44,23 +44,22 @@ mysql --defaults-extra-file=$PWD/my.cnf -e "drop database pytition; create datab
4444
4545echo "Running database migrations"
4646
47- cd pytition && python3 ./manage.py migrate && cd -
47+ cd pytition && pdm run python3 ./manage.py migrate && cd -
4848
4949echo "Generating documentation"
5050
51- cd doc && make html
51+ cd doc && pdm run make html
5252cd -
5353
5454echo "Compiling translations"
5555
56- cd pytition && python3 ./manage.py compilemessages && cd -
56+ cd pytition && pdm run python3 ./manage.py compilemessages && cd -
5757
5858echo "Running tests"
5959
60- coverage erase
61- coverage run ./pytition/manage.py test --noinput petition
62- coverage xml --include='pytition/*'
63- deactivate
60+ pdm run coverage erase
61+ pdm run coverage run ./pytition/manage.py test --noinput petition
62+ pdm run coverage xml --include='pytition/*'
6463 '''
6564step([$class : ' CoberturaPublisher' ,
6665 autoUpdateHealth : false ,
0 commit comments