Setup as 'pip' library
Some checks failed
ydeng/mltraining/pipeline/head There was a failure building this commit
Some checks failed
ydeng/mltraining/pipeline/head There was a failure building this commit
This commit is contained in:
39
Jenkinsfile
vendored
Normal file
39
Jenkinsfile
vendored
Normal file
@@ -0,0 +1,39 @@
|
||||
pipeline {
|
||||
agent any
|
||||
stages {
|
||||
stage("install") {
|
||||
steps {
|
||||
sh 'mamba env update --file environment.yml --prefix ./env || mamba env create --force --file environment.yml --prefix ./env'
|
||||
sh 'echo conda environment: $CONDA_PREFIX'
|
||||
}
|
||||
}
|
||||
stage("unit tests") {
|
||||
steps {
|
||||
dir('avarias') {
|
||||
sh returnStatus: true, script: "python -m pytest --junitxml=test_results.tests.xml --cov-report xml:test_coverage.coverage.xml --cov=mltraining"
|
||||
xunit checksName: '', thresholdMode: 2, thresholds: [failed(unstableThreshold: '90')], tools: [JUnit(excludesPattern: '', pattern: 'test_results.tests.xml', stopProcessingIfError: true)]
|
||||
// cobertura autoUpdateHealth: false, autoUpdateStability: false, coberturaReportFile: 'test_coverage.coverage.xml', failUnhealthy: false, failUnstable: false, maxNumberOfBuilds: 64, lineCoverageTargets: '50, 0, 0', methodCoverageTargets: '50, 0, 0', onlyStable: false, sourceEncoding: 'ASCII', zoomCoverageChart: false
|
||||
}
|
||||
}
|
||||
}
|
||||
stage("build") {
|
||||
steps {
|
||||
dir('avarias') {
|
||||
sh 'rm -rf ./dist/*'
|
||||
sh "python -m build"
|
||||
}
|
||||
}
|
||||
}
|
||||
stage("publish") {
|
||||
environment {
|
||||
CREDS = credentials('rs-git-package-registry-ydeng')
|
||||
}
|
||||
when {
|
||||
branch '**/main'
|
||||
}
|
||||
steps {
|
||||
sh returnStatus: true, script: 'python -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/*'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user