commit c132464b088b3ac6d5dcb22359f5411d3d91c54b
parent 36727b0924e1ffca4a4464b1ae470495d4fa9486
Author: Andreas Gruhler <agruhl@gmx.ch>
Date:   Sat, 23 Aug 2025 17:35:55 +0200
feat(Jenkinsfile): change texlive img, fix artefacts
Diffstat:
1 file changed, 19 insertions(+), 13 deletions(-)
diff --git a/Jenkinsfile b/Jenkinsfile
@@ -3,20 +3,26 @@
 node('podman'){
   checkout scm
 
-  stage('build-pdf') {
-      docker.image('registry.gitlab.com/islandoftex/images/texlive:latest')
+  try {
+    stage('build-pdf') {
+      docker.image('docker.io/mfisherman/texlive-full:latest')
       .inside('-u root --entrypoint=""') {
-          sh '''
-          pwd
-          ls -l
-          latexmk -c
-          latexmk -pdf main.tex
-          '''
-      }
-  }
-  post {
-      always {
-          archiveArtifacts artifacts: 'main.pdf', fingerprint: true
+        sh '''
+        latexmk -c
+        latexmk -pdf main.tex
+        '''
       }
+    }
+  } catch (e) {
+    // Since we're catching the exception in order to report on it,
+    // we need to re-throw it, to ensure that the build is marked as failed
+    throw e
+  } finally {
+    // create pdf artifacts if build was successful
+    // https://www.jenkins.io/doc/pipeline/tour/running-multiple-steps/#finishing-up
+    def currentResult = currentBuild.result ?: 'SUCCESS'
+    if (currentResult == "SUCCESS") {
+      archiveArtifacts artifacts: 'main.pdf', fingerprint: true
+    }
   }
 }