From 898ce6ecab8e1dd1c2d60b0aa07d21ad20d9f8e8 Mon Sep 17 00:00:00 2001 From: Clemens Lauermann Date: Mon, 27 Apr 2020 18:43:41 +0200 Subject: [PATCH] fix breaking typo in 6266a90 --- Jenkinsfile | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index af6f951..39f7ae1 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -24,7 +24,7 @@ pipeline { ) choice( name: 'ARCHIVE_FORMAT', - choices: ['diplomarbeit.zip', 'diplomarbeit.tar.gz'], + choices: ['zip', 'tar.gz'], description: 'Archiv-Typ als der die Arbeit per Mail versandt wird') } @@ -63,6 +63,9 @@ pipeline { // be sure branch is set env.GIT_BRANCH = params.GIT_BRANCH ?: '*/master' + + // output archive filename + env.ARCHIVE_FILENAME = "diplomarbeit." + params.ARCHIVE_FORMAT } } } @@ -149,10 +152,10 @@ pipeline { stage('Create Archive') { steps { dir(env.GIT_PATH) { - if (param.ARCHIVE_FORMAT == 'diplomarbeit.zip') { - sh "zip -q diplomarbeit.zip diplomarbeit.pdf* spellcheck-results.txt" + if (params.ARCHIVE_FORMAT == 'zip') { + sh "zip -q ${env.ARCHIVE_FILENAME} diplomarbeit.pdf* spellcheck-results.txt" } else { - sh "tar -czf diplomarbeit.tar.gz diplomarbeit.pdf* spellcheck-results.txt" + sh "tar -czf ${env.ARCHIVE_FILENAME} diplomarbeit.pdf* spellcheck-results.txt" } } } @@ -178,7 +181,7 @@ pipeline { } } dir(env.GIT_PATH) { - emailext attachmentsPattern: "${param.ARCHIVE_FORMAT}", + emailext attachmentsPattern: "${env.ARCHIVE_FILENAME}", to: "${env.RECIPIENTS}", subject: "[${currentBuild.currentResult}] Diplomarbeit Build #${env.BUILD_NUMBER}", body: "Job ${env.JOB_NAME}: ${env.JOB_URL}"