pipeline { agent any triggers { cron('H */6 * * *') pollSCM('H */3 * * *') } options { skipDefaultCheckout() } environment { DATA_SRC = "${env.WORKSPACE}/mnt/" VENV = "${env.WORKSPACE}/amt-jb-venv" } stages { stage('Checkout') { steps { checkout scmGit( branches: [[name: "*/${env.BRANCH_NAME}"]], extensions: [ cloneOption(shallow: true) ], userRemoteConfigs: [ [credentialsId: 'abdeb570-b708-44f3-b857-8a6b06ed9822', url: 'ssh://code.g-r-l.com:6611/panels/amt-jb'] ], ) stash name: 'source', useDefaultExcludes: false } } stage('Python Versions') { matrix { axes { axis { name 'VER' values 'python3.14' } } stages { stage('Setup') { steps { dir("amt-jb-${VER}") { deleteDir() unstash 'source' withCredentials([file( credentialsId: '5cfa9a3a-3c26-499d-832f-0916d524fe05', variable: 'ENV_TEST_FILE')]) { sh 'cp $ENV_TEST_FILE .env.test' } sh "/usr/local/bin/${VER} -m venv ${VENV}-${VER}" withCredentials([sshUserPrivateKey( credentialsId: 'abdeb570-b708-44f3-b857-8a6b06ed9822', keyFileVariable: 'SSH_PRIVATE_KEY')]) { sh """ eval \$(ssh-agent) && ssh-add ${SSH_PRIVATE_KEY} && \ ${VENV}-${VER}/bin/pip install -r requirements.txt ${VENV}-${VER}/bin/pip install django """ } } } } stage('tests') { steps { dir("amt-jb-${VER}") { sh "${VENV}-${VER}/bin/pytest tests/test_postgres.py -vs" sh "${VENV}-${VER}/bin/pytest tests/models -vs" sh "${VENV}-${VER}/bin/pytest tests/managers -vs" sh "${VENV}-${VER}/bin/pytest tests/http -vs" } } } } } } } post { always { echo 'One way or another, I have finished' deleteDir() /* clean up our workspace */ } } }