diff --git a/Jenkinsfile b/Jenkinsfile index 169fc24..2c156f5 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -20,6 +20,12 @@ pipeline { string(name: 'BRANCH', defaultValue: 'master', description: 'Branch') } stages { + stage('Clean checkout of the template') { + steps{ + cleanWs() + checkout scm + } + } stage('Checkout DA') { when { expression { '.git' != params.REPOSITORY } @@ -44,11 +50,11 @@ pipeline { } stage('Build only template') { when { - expression { '.git' == params.Repository } + expression { '.git' == params.REPOSITORY } } steps { sh ''' - mkdir HTLLE-DA-Vorlage && mv * HTLLE-DA-Vorlage + mkdir -p HTLLE-DA-Vorlage && mv `ls | grep -v HTLLE-DA-Vorlage` HTLLE-DA-Vorlage cp -rv HTLLE-DA-Vorlage/example/* . make pdf -C HTLLE-DA-Vorlage SOURCEDIR=$(pwd) ''' @@ -56,17 +62,16 @@ pipeline { } stage('Test if diplomarbeit.pdf was build') { steps { - sh "test -f output/diplomarbeit.pdf" + sh "test -f diplomarbeit.pdf" } } } post { always { - emailext attachLog: true, attachmentsPattern: 'output/**', + emailext attachLog: true, attachmentsPattern: 'diplomarbeit.pdf', body: "${currentBuild.currentResult}: Job ${env.JOB_NAME} build ${env.BUILD_NUMBER}", recipientProviders: [requestor()], subject: "Jenkins Diplomarbeit Build ${currentBuild.currentResult}" - cleanWs() } } }