First try with Jenkinsfile, hope for the best
This commit is contained in:
32
scripts/build.sh
Normal file
32
scripts/build.sh
Normal 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
|
||||
Reference in New Issue
Block a user