Skip to content

Commit

Permalink
ci: fix the file changed as we read it
Browse files Browse the repository at this point in the history
  • Loading branch information
v1v committed May 13, 2020
1 parent 3563a8d commit df947c2
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -1196,11 +1196,15 @@ def runbld() {
def stashV2(Map args = [:]) {
def name = args.name
def filename = "${name}.zip"
def command = "tar -czf ${filename} ."
def folder = '.artefacts'
dir(folder) {
log(level: 'DEBUG', text: 'stashV2: create artefacts folder to fix the tar: file changed as we read it.')
}
def command = "tar -czf"
if(isUnix()) {
sh(label: 'Archive', script: command)
sh(label: 'Archive', script: "${command} ${folder}/${filename} --exclude=${folder} . ; mv ${folder}/${filename} ${filename}")
} else {
bat(label: 'Archive', script: command)
bat(label: 'Archive', script: "${command} ${folder}\\${filename} --exclude=${folder} . && move ${folder}\\${filename} ${filename}")
}
googleStorageUpload(
bucket: "gs://${JOB_GCS_BUCKET}/${JOB_NAME}-${BUILD_NUMBER}/${name}",
Expand Down

0 comments on commit df947c2

Please sign in to comment.