use tmp as a staging place for building the tgz file

pull/24/head
Adam Townsend 2023-10-16 16:35:56 -07:00
parent 9e5a4069a4
commit eed17d61a3
1 changed files with 7 additions and 5 deletions

12
Jenkinsfile vendored
View File

@ -49,11 +49,13 @@ pipeline {
steps { steps {
catchError(buildResult: 'FAILURE', stageResult: 'FAILURE') { catchError(buildResult: 'FAILURE', stageResult: 'FAILURE') {
sh ''' #!/usr/local/bin/bash sh ''' #!/usr/local/bin/bash
mkdir -p url-shortener CUR_DIR=$(pwd)
shopt -s extglob mkdir -p /tmp/url-shortener
cp -R !(url-shortener) url-shortener/ cp -R * /tmp/url-shortener
rm -rf url-shortener/features url-shortener/spec url-shortener/coverage rm -rf /tmp/url-shortener/features /tmp/url-shortener/spec /tmp/url-shortener/coverage .git*
cd /tmp
tar -czvf url-shortener.tgz url-shortener/ tar -czvf url-shortener.tgz url-shortener/
mv url-shortener.tgz $CUR_DIR
''' '''
} }
archiveArtifacts artifacts: 'url-shortener.tgz' archiveArtifacts artifacts: 'url-shortener.tgz'
@ -61,7 +63,7 @@ pipeline {
} }
stage('Clean up deliverable') { stage('Clean up deliverable') {
steps { steps {
sh 'rm -rf url-shortener' sh 'rm -rf /tmp/url-shortener'
sh 'rm -rf url-shortener.tgz' sh 'rm -rf url-shortener.tgz'
} }
} }