From eed17d61a340a031032bcc78b4e13cf45cb5a884 Mon Sep 17 00:00:00 2001 From: Adam Townsend Date: Mon, 16 Oct 2023 16:35:56 -0700 Subject: [PATCH] use tmp as a staging place for building the tgz file --- Jenkinsfile | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 436d7a2..612b705 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -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' } }