diff options
| author | Max Nanis | 2026-08-30 22:33:31 -0700 |
|---|---|---|
| committer | Max Nanis | 2026-08-30 22:33:31 -0700 |
| commit | 26add6d8109a9bc3a63b68dea90b8d8e0baa042f (patch) | |
| tree | 4bdb346dfb029f6db1d166c15c9807ac6e8e264e /Jenkinsfile | |
| parent | 4e5d454ab6c90d1a6c3e42250e9b5dfbae58c4a2 (diff) | |
| download | generalresearch-26add6d8109a9bc3a63b68dea90b8d8e0baa042f.tar.gz generalresearch-26add6d8109a9bc3a63b68dea90b8d8e0baa042f.zip | |
jenkins p3
Diffstat (limited to 'Jenkinsfile')
| -rw-r--r-- | Jenkinsfile | 53 |
1 files changed, 33 insertions, 20 deletions
diff --git a/Jenkinsfile b/Jenkinsfile index 8c03490..6d15c96 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,4 +1,10 @@ pipeline { + agent any + + parameters { + string(name: 'BRANCH', defaultValue: 'main', description: 'Branch to build') + } + triggers { cron('H */12 * * *') pollSCM('H */6 * * *') @@ -13,8 +19,22 @@ pipeline { } stages { - stage('python versions') { + stage('Checkout') { + steps { + checkout scmGit( + branches: [[name: "*/${params.BRANCH}"]], + extensions: [ cloneOption(shallow: true) ], + userRemoteConfigs: [ + [credentialsId: 'abdeb570-b708-44f3-b857-8a6b06ed9822', + url: 'ssh://code.g-r-l.com:6611/generalresearch'] + ], + ) + stash name: 'source', useDefaultExcludes: false + } + } + + stage('python versions') { matrix { axes { axis { @@ -26,30 +46,23 @@ pipeline { stages { stage('Setup') { - agent { label 'any' } steps { - cleanWs() - dir("generalresearch/$PYTHON_VERSION/") { - 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/generalresearch'] - ], - ) - sh "/usr/local/bin/$PYTHON_VERSION -m venv $VENV-$PYTHON_VERSION" - sh "$VENV-$PYTHON_VERSION/bin/pip install -U setuptools wheel pip" - sh "$VENV-$PYTHON_VERSION/bin/pip install -r requirements.txt" - sh "$VENV-$PYTHON_VERSION/bin/pip install '.[django]'" + dir("generalresearch-${PYTHON_VERSION}") { + deleteDir() + unstash 'source' + + sh "/usr/local/bin/${PYTHON_VERSION} -m venv ${VENV}-${PYTHON_VERSION}" + sh "${VENV}-${PYTHON_VERSION}/bin/pip install -U setuptools wheel pip" + sh "${VENV}-${PYTHON_VERSION}/bin/pip install -r requirements.txt" + sh "${VENV}-${PYTHON_VERSION}/bin/pip install '.[django]'" } } } stage('base') { steps { - dir("generalresearch/$PYTHON_VERSION/") { - sh "$VENV-$PYTHON_VERSION/bin/pytest tests/models/gr/test_base.py -vs" + dir("generalresearch-${PYTHON_VERSION}") { + sh "${VENV}-${PYTHON_VERSION}/bin/pytest tests/models/gr/test_base.py -vs" } } } @@ -62,7 +75,7 @@ pipeline { post { always { echo 'One way or another, I have finished' - deleteDir() /* clean up our workspace */ + deleteDir() } } -} +}
\ No newline at end of file |
