node { stage('Pull git') { checkout scm } stage('Build PDF') { sh 'latexmk -c -xelatex -jobname=${REPO_NAME} main.tex' } stage('Archive PDF') { archiveArtifacts artifacts: '${REPO_NAME}.pdf', followSymlinks: false } stage('Publish PDF') { sh 'scp -i /root/.ssh/id_rsa ${REPO_NAME}.pdf thisfro@192.168.178.45:/opt/containers/apache2/html/download/latex-previews/${REPO_NAME}.pdf' } }