First try with Jenkinsfile, hope for the best

This commit is contained in:
2024-04-22 16:53:16 +02:00
parent 6e76c14c70
commit a439b45d2c
2 changed files with 50 additions and 0 deletions

18
Jenkinsfile vendored Normal file
View File

@@ -0,0 +1,18 @@
pipeline {
agent linux {
stages {
stage('Build') {
steps {
echo 'Starting build step...'
sh './scripts/build.sh'
}
}
// Testing latex isn't really a thing, but we could do basic sanity checks in the future?
stage('Deploy') {
echo 'Starting deploy step...'
}
}
}
}

32
scripts/build.sh Normal file
View File

@@ -0,0 +1,32 @@
#!/bin/bash
# Check if necessary packages are installed
necessary_packages=("pdflatex")
for package in ${necessary_packages}; do
if ! [dpkg -l ${package} > /dev/null]; then
echo "Error: ${package} is not installed."
exit 1
fi
done
# Build all directories
subdirectory_file_name=main
for D in *; do
if [ -d "${D}" ]; then
echo "Building ${D}..."
cd ${D}
pdflatex -interaction=nonstopmode -halt-on-error ${subdirectory_file_name}.tex
cd ..
fi
done
# Build main PDF
main_file_name=main_text
echo "Building main PDF..."
pdflatex -interaction=nonstopmode -halt-on-error ${main_file_name}.tex
# Clean up
rm -rf *.aux *.log *.out *.toc