node { stage('Pull git') { checkout scm } stage('Build PDF') { sh 'latexmk -xelatex -jobname=lsd-exam main.tex' } stage('Archive PDF') { archiveArtifacts artifacts: 'lsd-exam.pdf', followSymlinks: false } stage('Publish PDF') { sh 'cp lsd-exam.pdf /mnt/latex-previews/lsd-exam.pdf' } cleanWs notFailBuild: true }