added stages to build a deliverable and then clean it up when done

pull/24/head
Adam Townsend 2023-10-16 10:50:22 -07:00
parent 5631ae386f
commit b56b618a8c
1 changed files with 17 additions and 1 deletions

18
Jenkinsfile vendored
View File

@ -35,7 +35,6 @@ pipeline {
}
stage('Report results') {
steps {
archive(includes: 'pkg/*.gem')
publishHTML (target: [
allowMissing: false,
alwaysLinkToLastBuild: false,
@ -47,6 +46,23 @@ pipeline {
}
}
}
stage('Build deliverable') {
steps {
sh 'mkdir url-shortener'
sh 'shopt -s extglob && cp -R !(url-shortener) url-shortener/'
sh 'rm -rf url-shortener/features'
sh 'rm -rf url-shortener/spec'
sh 'rm -rf url-shortener/coverage'
sh 'tar -czvf url-shortener.tgz url-shortener/'
archiveArtifacts artifacts: 'url-shortener.tgz'
}
}
stage('Clean up deliverable') {
steps {
sh 'rm -rf url-shortener'
sh 'rm -rf url-shortener.tgz'
}
}
post {
success {
mattermostSend channel: 'git-messages', color: 'good', message: "[${JOB_NAME}](${JOB_URL}) [#${BUILD_NUMBER}](${BUILD_URL}) ([Gitea](${GIT_URL}))", text: 'Build Finished Successfully'