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