2025-01-08 15:14:06 +00:00
|
|
|
pipeline {
|
|
|
|
agent {
|
|
|
|
kubernetes {
|
|
|
|
cloud 'rsys-devel'
|
2025-01-22 18:29:37 +00:00
|
|
|
defaultContainer 'pip'
|
|
|
|
inheritFrom 'pip'
|
2025-01-08 15:14:06 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
stages {
|
|
|
|
stage("install") {
|
|
|
|
steps {
|
2025-01-22 18:29:37 +00:00
|
|
|
sh 'python -m pip install -r requirements.txt'
|
2025-01-08 15:14:06 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
stage("unit tests") {
|
|
|
|
steps {
|
2025-01-22 18:29:37 +00:00
|
|
|
sh returnStatus: true, script: "python -m pytest --junitxml=test_results.xml --cov=src --cov-report xml:coverage.xml"
|
2025-01-08 15:14:06 +00:00
|
|
|
xunit checksName: '', tools: [JUnit(excludesPattern: '', pattern: 'test_results.xml', stopProcessingIfError: true)]
|
2025-01-09 16:08:30 +00:00
|
|
|
recordCoverage(tools: [[parser: 'COBERTURA', pattern: 'coverage.xml']])
|
2025-01-08 15:14:06 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
stage("build") {
|
|
|
|
steps {
|
2025-01-20 16:54:00 +00:00
|
|
|
sh "python -m build"
|
2025-01-08 15:14:06 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
stage("archive") {
|
|
|
|
steps {
|
2025-01-22 18:29:37 +00:00
|
|
|
archiveArtifacts artifacts: 'dist/*.tar.gz, dist/*.whl', fingerprint: true, followSymlinks: false, onlyIfSuccessful: true
|
2025-01-08 15:14:06 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
stage("publish") {
|
2025-01-16 21:22:49 +00:00
|
|
|
parallel {
|
2025-01-22 18:29:37 +00:00
|
|
|
stage ("git.reslate.systems") {
|
2025-01-16 21:22:49 +00:00
|
|
|
environment {
|
2025-01-22 18:24:04 +00:00
|
|
|
CREDS = credentials('username-password-rs-git')
|
2025-01-16 21:22:49 +00:00
|
|
|
}
|
|
|
|
steps {
|
2025-01-22 18:24:04 +00:00
|
|
|
sh returnStatus: true, script: 'python -m twine upload --repository-url https://git.reslate.systems/api/packages/ydeng/pypi -u ${CREDS_USR} -p ${CREDS__PSW} --non-interactive --disable-progress-bar --verbose dist/*'
|
2025-01-16 21:22:49 +00:00
|
|
|
}
|
|
|
|
}
|
2025-01-22 18:29:37 +00:00
|
|
|
stage ("pypi.org") {
|
2025-01-16 21:22:49 +00:00
|
|
|
when {
|
|
|
|
tag '*.*'
|
|
|
|
}
|
|
|
|
environment {
|
2025-01-22 18:29:37 +00:00
|
|
|
TOKEN = credentials('pypi.org')
|
2025-01-16 21:22:49 +00:00
|
|
|
}
|
|
|
|
steps {
|
2025-01-17 15:13:47 +00:00
|
|
|
sh returnStatus: true, script: 'python -m twine upload -u __token__ -p ${TOKEN} --non-interactive --disable-progress-bar --verbose dist/*'
|
2025-01-16 21:22:49 +00:00
|
|
|
}
|
|
|
|
}
|
2025-01-08 15:14:06 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|