2025-01-03 19:26:21 +00:00
|
|
|
pipeline {
|
|
|
|
agent {
|
|
|
|
kubernetes {
|
|
|
|
cloud 'rsys-devel'
|
|
|
|
defaultContainer 'homebrew'
|
|
|
|
inheritFrom 'homebrew'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
stages {
|
|
|
|
stage("install") {
|
|
|
|
steps {
|
|
|
|
sh 'brew install python@3.11 sphinx-doc'
|
|
|
|
sh 'python3.11 -m pip install -r requirements.txt'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
stage("unit tests") {
|
|
|
|
steps {
|
|
|
|
sh returnStatus: true, script: "python3.11 -m pytest --junitxml=test_results.xml"
|
|
|
|
xunit checksName: '', tools: [JUnit(excludesPattern: '', pattern: 'test_results.xml', stopProcessingIfError: true)]
|
|
|
|
}
|
|
|
|
}
|
2025-01-03 19:40:11 +00:00
|
|
|
stage("build") {
|
|
|
|
sh "python3.11 -m build"
|
|
|
|
}
|
2025-01-03 19:26:21 +00:00
|
|
|
stage("test installation") {
|
|
|
|
steps {
|
|
|
|
sh "python3.11 -m pip install dist/*.whl --force-reinstall"
|
|
|
|
sh "mlstmyfasta -h"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
stage("archive") {
|
|
|
|
steps {
|
|
|
|
archiveArtifacts artifacts: 'dist/*.tar.gz, dist/*.whl', fingerprint: true, followSymlinks: false, onlyIfSuccessful: true
|
|
|
|
}
|
|
|
|
}
|
|
|
|
stage("publish") {
|
|
|
|
environment {
|
|
|
|
CREDS = credentials('git.reslate.systems/ydeng')
|
|
|
|
}
|
|
|
|
when {
|
|
|
|
branch '**/main'
|
|
|
|
}
|
|
|
|
steps {
|
|
|
|
sh returnStatus: true, script: 'python3.11 -m twine upload --repository-url https://git.reslate.systems/api/packages/${CREDS_USR}/pypi -u ${CREDS_USR} -p ${CREDS_PSW} --non-interactive --disable-progress-bar --verbose dist/*'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|