diff options
Diffstat (limited to 'Jenkinsfile')
| -rw-r--r-- | Jenkinsfile | 64 |
1 files changed, 45 insertions, 19 deletions
diff --git a/Jenkinsfile b/Jenkinsfile index e962b3e..3497c61 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,7 +1,3 @@ -/* This is intended to test the dev & master branches of the gr-api project, - where the tests are entirely self contained -*/ - pipeline { agent any @@ -20,28 +16,58 @@ pipeline { } stages { - - stage('setup') { + stage('Checkout') { steps { - withCredentials([file( - credentialsId: '971e1f48-09ce-4446-9155-a52c1adb6249', - variable: 'ENV_TEST_FILE')]) { - sh 'cp $ENV_TEST_FILE .env.test' - } - sh "/usr/local/bin/python3.14 -m venv ${VENV}" - sh "${VENV}/bin/pip install -U setuptools wheel pip" - sh "${VENV}/bin/pip install -r requirements.txt" - sh "${VENV}/bin/pip install django" + 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('tests') { - steps { - sh '$VENV/bin/pytest tests/test_postgres.py -vs' + stage('Python Versions') { + matrix { + axes { + axis { + name 'VER' + values 'python3.14', 'python3.13', 'python3.12' + } + } + + stages { + stage('Setup') { + steps { + dir("amt-jb-${VER}") { + deleteDir() + unstash 'source' + + withCredentials([file( + credentialsId: '971e1f48-09ce-4446-9155-a52c1adb6249', + variable: 'ENV_TEST_FILE')]) { + sh 'cp $ENV_TEST_FILE .env.test' + } + sh "/usr/local/bin/${VER} -m venv ${VENV}-${VER}" + sh "${VENV}-${VER}/bin/pip install -r requirements.txt" + sh "${VENV}-${VER}/bin/pip install django" + } + } + } + + stage('tests') { + steps { + sh "${VENV}-${VER}/bin/pytest tests/test_postgres.py -vs" + } + } + } } } - } + post { always { echo 'One way or another, I have finished' |
