From 921bdd3f46feb7e167dc81c12ea6e177c3c78191 Mon Sep 17 00:00:00 2001 From: Billy Brawner Date: Sun, 2 Sep 2018 21:04:35 -0500 Subject: [PATCH] Delete deployment directory if it exists --- Jenkinsfile | 1 + 1 file changed, 1 insertion(+) diff --git a/Jenkinsfile b/Jenkinsfile index 764f561..529efc5 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -29,6 +29,7 @@ pipeline { steps { sshPut remote: remote, from: 'archive.zip', into: '.' sshCommand remote: remote, command: """ + if [ test -d /var/www/budget.wbrawner.com/revisions/$GIT_COMMIT ]; then rm -rf /var/www/budget.wbrawner.com/revisions/$GIT_COMMIT; fi && \ mkdir -p /var/www/budget.wbrawner.com/revisions/$GIT_COMMIT && \ unzip -d /var/www/budget.wbrawner.com/revisions/$GIT_COMMIT /root/archive.zip && \ rm /root/archive.zip && \