Skip to content

Commit 2037088

Browse files
committed
CI: use pdm in CI
1 parent 33efa1d commit 2037088

File tree

1 file changed

+10
-11
lines changed

1 file changed

+10
-11
lines changed

Jenkinsfile

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@ node {
77
checkout scm
88

99
sh '''
10+
export PATH=/var/lib/jenkins/.local/bin:$PATH # needed for pdm
1011
cd $WORKSPACE
1112
git 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
1515
cat <<ENDOFFILE > my.cnf
1616
[client]
1717
database = pytition
@@ -23,7 +23,7 @@ ENDOFFILE
2323
echo "Generating a basic config file"
2424
2525
echo "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
2727
cat <<EOT >> pytition/pytition/settings/config.py
2828
DATABASES = {
2929
'default': {
@@ -44,23 +44,22 @@ mysql --defaults-extra-file=$PWD/my.cnf -e "drop database pytition; create datab
4444
4545
echo "Running database migrations"
4646
47-
cd pytition && python3 ./manage.py migrate && cd -
47+
cd pytition && pdm run python3 ./manage.py migrate && cd -
4848
4949
echo "Generating documentation"
5050
51-
cd doc && make html
51+
cd doc && pdm run make html
5252
cd -
5353
5454
echo "Compiling translations"
5555
56-
cd pytition && python3 ./manage.py compilemessages && cd -
56+
cd pytition && pdm run python3 ./manage.py compilemessages && cd -
5757
5858
echo "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
'''
6564
step([$class: 'CoberturaPublisher',
6665
autoUpdateHealth: false,

0 commit comments

Comments
 (0)