From acd2926a5b79e07eda972e381c32c83538aa8267 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=98ystein=20Kristoffer=20Tveit?= Date: Wed, 24 Mar 2021 13:46:37 +0000 Subject: [PATCH] Add gitlab ci for compiling documents --- .gitlab-ci.yml | 15 +++++++++++++++ README.md | 37 +++++++++++++++++++++++++++++++++++++ generate_pdfs.sh | 16 ++++++++++++++++ 3 files changed, 68 insertions(+) create mode 100644 .gitlab-ci.yml create mode 100755 generate_pdfs.sh diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000..c73626f --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,15 @@ +image: texlive/texlive + +stages: + - pages + +pages: + stage: pages + script: + - git clone https://gitlab-ci-token:${CI_JOB_TOKEN}@gitlab.stud.idi.ntnu.no/oysteikt/texmf.git ~/texmf + - "./generate_pdfs.sh" + artifacts: + paths: + - public/ + # only: + # master diff --git a/README.md b/README.md index e69de29..8961819 100644 --- a/README.md +++ b/README.md @@ -0,0 +1,37 @@ + +# MA0301 - Spring 2021 - Diskret Matematikk + + +| Num | Exercise PDF | My Solution PDF | Answer Sheet PDF | +| --- | ------------------------ | --------------- | ---------------- | +| 1 | [wiki.math.ntnu.no][ex1] | [ex1.pdf][so1] | [wiki.math.ntnu.no][as1] | +| 2 | [wiki.math.ntnu.no][ex2] | [ex2.pdf][so2] | [wiki.math.ntnu.no][as2] | +| 3 | [wiki.math.ntnu.no][ex3] | [ex3.pdf][so3] | [wiki.math.ntnu.no][as3] | +| 4 | [wiki.math.ntnu.no][ex4] | [ex4.pdf][so4] | [wiki.math.ntnu.no][as4] | +| 5 | [wiki.math.ntnu.no][ex5] | [ex5.pdf][so5] | | +| 6 | [wiki.math.ntnu.no][ex6] | [ex6.pdf][so6] | | +| 7 | [wiki.math.ntnu.no][ex7] | [ex7.pdf][so7] | | +| 8 | [wiki.math.ntnu.no][ex8] | [ex8.pdf][so8] | | + +[ex1]: https://wiki.math.ntnu.no/_media/ma0301/2021v/set-1-2021-new.pdf "Exercise 1 Questions" +[ex2]: https://wiki.math.ntnu.no/_media/ma0301/2021v/set-2-2021-new.pdf "Exercise 2 Questions" +[ex3]: https://wiki.math.ntnu.no/_media/ma0301/2021v/set-3-2021.pdf "Exercise 3 Questions" +[ex4]: https://wiki.math.ntnu.no/_media/ma0301/2021v/set-4-2021.pdf "Exercise 4 Questions" +[ex5]: https://wiki.math.ntnu.no/_media/ma0301/2021v/set-5-2021.pdf "Exercise 5 Questions" +[ex6]: https://wiki.math.ntnu.no/_media/ma0301/2021v/set-6-2021.pdf "Exercise 6 Questions" +[ex7]: https://wiki.math.ntnu.no/_media/ma0301/2021v/set-7-2021.pdf "Exercise 7 Questions" +[ex8]: https://wiki.math.ntnu.no/_media/ma0301/2021v/set-8-2021.pdf "Exercise 8 Questions" + +[so1]: http://oysteikt.pages.stud.idi.ntnu.no/v21-ma0301/exercise1.pdf "Exercise 1 Solutions" +[so2]: http://oysteikt.pages.stud.idi.ntnu.no/v21-ma0301/exercise2.pdf "Exercise 2 Solutions" +[so3]: http://oysteikt.pages.stud.idi.ntnu.no/v21-ma0301/exercise3.pdf "Exercise 3 Solutions" +[so4]: http://oysteikt.pages.stud.idi.ntnu.no/v21-ma0301/exercise4.pdf "Exercise 4 Solutions" +[so5]: http://oysteikt.pages.stud.idi.ntnu.no/v21-ma0301/exercise5.pdf "Exercise 5 Solutions" +[so6]: http://oysteikt.pages.stud.idi.ntnu.no/v21-ma0301/exercise6.pdf "Exercise 6 Solutions" +[so7]: http://oysteikt.pages.stud.idi.ntnu.no/v21-ma0301/exercise7.pdf "Exercise 7 Solutions" +[so8]: http://oysteikt.pages.stud.idi.ntnu.no/v21-ma0301/exercise8.pdf "Exercise 8 Solutions" + +[as1]: https://wiki.math.ntnu.no/_media/ma0301/2021v/set-1-2021-solutions.pdf "Exercise 1 Answer sheet" +[as2]: https://wiki.math.ntnu.no/_media/ma0301/2021v/set-2-2021-solutions.pdf "Exercise 2 Answer sheet" +[as3]: https://wiki.math.ntnu.no/_media/ma0301/2021v/set-3-2021-solutions.pdf "Exercise 3 Answer sheet" +[as4]: https://wiki.math.ntnu.no/_media/ma0301/2021v/set-4-2021-solutions.pdf "Exercise 4 Answer sheet" \ No newline at end of file diff --git a/generate_pdfs.sh b/generate_pdfs.sh new file mode 100755 index 0000000..b326ba8 --- /dev/null +++ b/generate_pdfs.sh @@ -0,0 +1,16 @@ +#!/bin/sh + +mkdir -p public +for file in $(find -name main.tex) +do + cd $(dirname $file) + pdflatex \ + -interaction nonstopmode \ + -halt-on-error \ + -output-directory ../public \ + -jobname=$(dirname $file | cut -c 3-) \ + $(basename $file) + cd .. +done + +find public -type f ! -name '*.pdf' -delete \ No newline at end of file