From e95f5b5ac9b067f7b9e94bc00d41648d1320b754 Mon Sep 17 00:00:00 2001 From: Harrison Date: Fri, 21 Apr 2023 11:23:56 -0500 Subject: [PATCH] Added test installation and archiving stages to 'Jenkinsfile' --- Jenkinsfile | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 0a001d1..1460814 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,10 +1,15 @@ pipeline { agent any stages { + stage("clean") { + steps { + sh 'rm -rf ./dist/*' + } + } stage("install") { steps { - sh 'conda env update --file environment.yml' - sh 'echo "conda activate renamebycsv" >> ~/.bashrc' + sh 'mamba env update --file environment.yml' + sh 'echo "mamba activate renamebycsv" >> ~/.bashrc' } } stage("build") { @@ -12,9 +17,19 @@ pipeline { sh "python -m build" } } - stage("publish") { + stage("test") { + steps { + sh "pip install dist/*.whl" + } + } + stage("archive") { + steps { + archiveArtifacts artifacts: 'dist/*.tar.gz, dist/*.whl' + } + } + stage("publish package") { when { - branch '**/master' + branch '**/main' } steps { withCredentials([usernamePassword(credentialsId: 'rs-git-package-registry-ydeng', passwordVariable: 'PASS', usernameVariable: 'USER')]) {