2025-01-08 15:14:06 +00:00
|
|
|
pipeline {
|
|
|
|
agent {
|
|
|
|
kubernetes {
|
|
|
|
cloud 'rsys-devel'
|
2025-01-20 19:56:51 +00:00
|
|
|
defaultContainer 'miniforge3'
|
|
|
|
inheritFrom 'miniforge'
|
2025-01-08 15:14:06 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
stages {
|
|
|
|
stage("install") {
|
|
|
|
steps {
|
2025-01-20 19:56:51 +00:00
|
|
|
sh 'conda env update -n base -f environment.yml'
|
2025-01-08 15:14:06 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
stage("unit tests") {
|
|
|
|
steps {
|
2025-01-20 19:56:51 +00:00
|
|
|
sh returnStatus: true, script: "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") {
|
2025-01-20 19:56:51 +00:00
|
|
|
environment {
|
|
|
|
GIT_AUTHOR_NAME = "Harrison Deng"
|
|
|
|
GIT_AUTHOR_EMAIL = "yunyangdeng@outlook.com"
|
|
|
|
}
|
2025-01-08 15:14:06 +00:00
|
|
|
steps {
|
2025-01-20 16:54:00 +00:00
|
|
|
sh "python -m build"
|
2025-01-22 18:24:04 +00:00
|
|
|
sh "grayskull pypi dist/*.tar.gz"
|
|
|
|
sh "conda-build autobigsst.engine --output-folder conda-bld"
|
2025-01-08 15:14:06 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
stage("archive") {
|
|
|
|
steps {
|
2025-01-20 19:56:51 +00:00
|
|
|
archiveArtifacts artifacts: 'dist/*.tar.gz, dist/*.whl conda-bld/**/*.conda', 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-20 19:56:51 +00:00
|
|
|
stage ("internal") {
|
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-20 19:56:51 +00:00
|
|
|
stage ("external") {
|
2025-01-16 21:22:49 +00:00
|
|
|
when {
|
|
|
|
tag '*.*'
|
|
|
|
}
|
|
|
|
environment {
|
2025-01-20 19:56:51 +00:00
|
|
|
PYPI_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
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|