From 9c232cebe105f9ddbdba40a1588f47d461a4ad4b Mon Sep 17 00:00:00 2001 From: Egon Elbre Date: Mon, 27 Sep 2021 19:36:04 +0300 Subject: [PATCH] ci: make deletion a separate step Deletion as a separate step so it's more understandable what's actually happening. Change-Id: Icb3cefe7e4093c56604af633ac0e02226bae42ac --- Jenkinsfile.public | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Jenkinsfile.public b/Jenkinsfile.public index 7e5cafc58..2ff06f372 100644 --- a/Jenkinsfile.public +++ b/Jenkinsfile.public @@ -19,7 +19,12 @@ pipeline { stages { stage('Checkout') { steps { - sh "chmod -R 777 ." // ensure Jenkins can delete the working directory, with before-checkout hook + // Delete any content left over from a previous run. + sh "chmod -R 777 ." + // Bash requires extglob option to support !(.git) syntax, + // and we don't want to delete .git to have faster clones. + sh 'bash -O extglob -c "rm -r !(.git)"' + checkout scm sh 'mkdir -p .build'