diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..564eccf --- /dev/null +++ b/.travis.yml @@ -0,0 +1,20 @@ +language: generic + +dist: trusty + +services: + - docker + +install: + - docker pull lamtev/latex-build-tools + +matrix: + include: + - env: LATEX_TEMPLATE="bachelor_thesis" + - env: LATEX_TEMPLATE="coursework" + - env: LATEX_TEMPLATE="presentation" + - env: LATEX_TEMPLATE="report" + +script: + - chmod +x travis_build.sh + - docker run -v $TRAVIS_BUILD_DIR:/latex_templates lamtev/latex-build-tools /bin/bash -c " cd latex_templates && . ./travis_build.sh && build_latex_template $LATEX_TEMPLATE " diff --git a/bachelor_thesis/thesis.tex b/bachelor_thesis/bachelor_thesis.tex similarity index 100% rename from bachelor_thesis/thesis.tex rename to bachelor_thesis/bachelor_thesis.tex diff --git a/coursework/main.tex b/coursework/coursework.tex similarity index 100% rename from coursework/main.tex rename to coursework/coursework.tex diff --git a/presentation/main.tex b/presentation/presentation.tex similarity index 100% rename from presentation/main.tex rename to presentation/presentation.tex diff --git a/report/main.tex b/report/report.tex similarity index 100% rename from report/main.tex rename to report/report.tex diff --git a/travis_build.sh b/travis_build.sh new file mode 100644 index 0000000..b9f63e5 --- /dev/null +++ b/travis_build.sh @@ -0,0 +1,21 @@ +#!/usr/bin/env bash + +build_latex_template() +{ + + if [ "$#" != "1" ]; then + echo "Invalid number of arguments!" + exit 1 + fi + + LATEX_TEMPLATE="$1" + cd $LATEX_TEMPLATE + + pdflatex $LATEX_TEMPLATE.tex + if [ "$LATEX_TEMPLATE" == "bachelor_thesis" ] || [ "$LATEX_TEMPLATE" == "coursework" ]; then + bibtex $LATEX_TEMPLATE.aux + fi + pdflatex $LATEX_TEMPLATE.tex + pdflatex $LATEX_TEMPLATE.tex + +}