# This file is a template, and might need editing before it works on your project.
# Full project: https://gitlab.com/pages/plain-html
#

stages:
  - preprocessor-test
  - preprocessor-run
  - pandoc-run
  - deploy

testing:
  stage: preprocessor-test
  allow_failure: false
  image: 
    name: alpine:latest
  script:
    - apk add --no-cache --upgrade bash
    - RESEARCH_ROOT=`pwd`; export RESEARCH_ROOT;
    # run shell script with testss
    - $RESEARCH_ROOT/bin/run-tests.sh
  artifacts:
    paths:
      - testing/*.log

preprocessing:
  stage: preprocessor-run
  allow_failure: false
  image: 
    name: alpine:latest
  script:
    - apk add --no-cache --upgrade bash
    - RESEARCH_ROOT=`pwd`; export RESEARCH_ROOT;
    # preprocess .MD files
    - $RESEARCH_ROOT/bin/preproc_topics.sh
  artifacts:
    paths:
      - build

pandoc: 
  stage: pandoc-run
  dependencies: [preprocessing]
  image:      
    name: pandoc/latex:latest
    entrypoint: ["/bin/sh", "-c"]
  script:
    # build research topics
    - pandoc --standalone build/topic-template.md -o build/topic-template.html  --mathjax -c css/base.css -c css/extra.css -c "css/print.css" -c "css/superfish.css" -c "css/superfish-vertical.css" -c "css/base_mode.css"
    - pandoc --standalone build/aperiodSchr.md -o build/aperiodSchr.html  --mathjax -c css/base.css -c css/extra.css -c "css/print.css" -c "css/superfish.css" -c "css/superfish-vertical.css" -c "css/base_mode.css"
    - pandoc --standalone build/Control_in_Banach_spaces.md -o build/Control_in_Banach_spaces.html  --mathjax -c css/base.css -c css/extra.css -c "css/print.css" -c "css/superfish.css" -c "css/superfish-vertical.css" -c "css/base_mode.css"
    - pandoc --standalone build/navier-stokes.md -o build/navier-stokes.html  --mathjax -c css/base.css -c css/extra.css -c "css/print.css" -c "css/superfish.css" -c "css/superfish-vertical.css" -c "css/base_mode.css"
    - pandoc --standalone build/Fractional_Powers_of_Linear_Operators.md -o build/Fractional_Powers_of_Linear_Operators.html  --mathjax -c css/base.css -c css/extra.css -c "css/print.css" -c "css/superfish.css" -c "css/superfish-vertical.css" -c "css/base_mode.css"
    - pandoc --standalone build/PinT-PDEopt.md -o build/PinT-PDEopt.html  --mathjax -c css/base.css -c css/extra.css -c "css/print.css" -c "css/superfish.css" -c "css/superfish-vertical.css" -c "css/base_mode.css"
    # build index
    - pandoc --standalone build/index.md -o build/index.html --mathjax -c css/base.css -c css/extra.css -c "css/print.css" -c "css/superfish.css" -c "css/superfish-vertical.css" -c "css/base_mode.css"
    # build static working group pages
    - pandoc --standalone ./build/aa.md -o ./build/aa.html --mathjax -c css/base.css -c css/extra.css -c "css/print.css" -c "css/superfish.css" -c "css/superfish-vertical.css" -c "css/base_mode.css"
    - pandoc --standalone ./build/dm.md -o ./build/dm.html --mathjax -c css/base.css -c css/extra.css -c "css/print.css" -c "css/superfish.css" -c "css/superfish-vertical.css" -c "css/base_mode.css"
    - pandoc --standalone ./build/cm.md -o ./build/cm.html --mathjax -c css/base.css -c css/extra.css -c "css/print.css" -c "css/superfish.css" -c "css/superfish-vertical.css" -c "css/base_mode.css"
    - pandoc --standalone ./build/nm.md -o ./build/nm.html --mathjax -c css/base.css -c css/extra.css -c "css/print.css" -c "css/superfish.css" -c "css/superfish-vertical.css" -c "css/base_mode.css"
    - pandoc --standalone ./build/st.md -o ./build/st.html --mathjax -c css/base.css -c css/extra.css -c "css/print.css" -c "css/superfish.css" -c "css/superfish-vertical.css" -c "css/base_mode.css"
    # build static staff pages (generated by create-staff-yml.sh)
    - pandoc --standalone ./build/ataraz.md -o ./build/ataraz.html --mathjax -c css/base.css -c css/extra.css -c "css/print.css" -c "css/superfish.css" -c "css/superfish-vertical.css" -c "css/base_mode.css"
    - pandoc --standalone ./build/cseifert.md -o ./build/cseifert.html --mathjax -c css/base.css -c css/extra.css -c "css/print.css" -c "css/superfish.css" -c "css/superfish-vertical.css" -c "css/base_mode.css"
    - pandoc --standalone ./build/dclemens.md -o ./build/dclemens.html --mathjax -c css/base.css -c css/extra.css -c "css/print.css" -c "css/superfish.css" -c "css/superfish-vertical.css" -c "css/base_mode.css"
    - pandoc --standalone ./build/dgallaun.md -o ./build/dgallaun.html --mathjax -c css/base.css -c css/extra.css -c "css/print.css" -c "css/superfish.css" -c "css/superfish-vertical.css" -c "css/base_mode.css"
    - pandoc --standalone ./build/druprecht.md -o ./build/druprecht.html --mathjax -c css/base.css -c css/extra.css -c "css/print.css" -c "css/superfish.css" -c "css/superfish-vertical.css" -c "css/base_mode.css"
    - pandoc --standalone ./build/fboesch.md -o ./build/fboesch.html --mathjax -c css/base.css -c css/extra.css -c "css/print.css" -c "css/superfish.css" -c "css/superfish-vertical.css" -c "css/base_mode.css"
    - pandoc --standalone ./build/fbuenger.md -o ./build/fbuenger.html --mathjax -c css/base.css -c css/extra.css -c "css/print.css" -c "css/superfish.css" -c "css/superfish-vertical.css" -c "css/base_mode.css"
    - pandoc --standalone ./build/fgabel.md -o ./build/fgabel.html --mathjax -c css/base.css -c css/extra.css -c "css/print.css" -c "css/superfish.css" -c "css/superfish-vertical.css" -c "css/base_mode.css"
    - pandoc --standalone ./build/fhamann.md -o ./build/fhamann.html --mathjax -c css/base.css -c css/extra.css -c "css/print.css" -c "css/superfish.css" -c "css/superfish-vertical.css" -c "css/base_mode.css"
    - pandoc --standalone ./build/hruan.md -o ./build/hruan.html --mathjax -c css/base.css -c css/extra.css -c "css/print.css" -c "css/superfish.css" -c "css/superfish-vertical.css" -c "css/base_mode.css"
    - pandoc --standalone ./build/hvoss.md -o ./build/hvoss.html --mathjax -c css/base.css -c css/extra.css -c "css/print.css" -c "css/superfish.css" -c "css/superfish-vertical.css" -c "css/base_mode.css"
    - pandoc --standalone ./build/jangel.md -o ./build/jangel.html --mathjax -c css/base.css -c css/extra.css -c "css/print.css" -c "css/superfish.css" -c "css/superfish-vertical.css" -c "css/base_mode.css"
    - pandoc --standalone ./build/jdornemann.md -o ./build/jdornemann.html --mathjax -c css/base.css -c css/extra.css -c "css/print.css" -c "css/superfish.css" -c "css/superfish-vertical.css" -c "css/base_mode.css"
    - pandoc --standalone ./build/jfregin.md -o ./build/jfregin.html --mathjax -c css/base.css -c css/extra.css -c "css/print.css" -c "css/superfish.css" -c "css/superfish-vertical.css" -c "css/base_mode.css"
    - pandoc --standalone ./build/jgrams.md -o ./build/jgrams.html --mathjax -c css/base.css -c css/extra.css -c "css/print.css" -c "css/superfish.css" -c "css/superfish-vertical.css" -c "css/base_mode.css"
    - pandoc --standalone ./build/jgrossmann.md -o ./build/jgrossmann.html --mathjax -c css/base.css -c css/extra.css -c "css/print.css" -c "css/superfish.css" -c "css/superfish-vertical.css" -c "css/base_mode.css"
    - pandoc --standalone ./build/jmeichsner.md -o ./build/jmeichsner.html --mathjax -c css/base.css -c css/extra.css -c "css/print.css" -c "css/superfish.css" -c "css/superfish-vertical.css" -c "css/base_mode.css"
    - pandoc --standalone ./build/jpmzemke.md -o ./build/jpmzemke.html --mathjax -c css/base.css -c css/extra.css -c "css/print.css" -c "css/superfish.css" -c "css/superfish-vertical.css" -c "css/base_mode.css"
    - pandoc --standalone ./build/jurizarna.md -o ./build/jurizarna.html --mathjax -c css/base.css -c css/extra.css -c "css/print.css" -c "css/superfish.css" -c "css/superfish-vertical.css" -c "css/base_mode.css"
    - pandoc --standalone ./build/kalbrecht.md -o ./build/kalbrecht.html --mathjax -c css/base.css -c css/extra.css -c "css/print.css" -c "css/superfish.css" -c "css/superfish-vertical.css" -c "css/base_mode.css"
    - pandoc --standalone ./build/kklioba.md -o ./build/kklioba.html --mathjax -c css/base.css -c css/extra.css -c "css/print.css" -c "css/superfish.css" -c "css/superfish-vertical.css" -c "css/base_mode.css"
    - pandoc --standalone ./build/kkruse.md -o ./build/kkruse.html --mathjax -c css/base.css -c css/extra.css -c "css/print.css" -c "css/superfish.css" -c "css/superfish-vertical.css" -c "css/base_mode.css"
    - pandoc --standalone ./build/mjanssen.md -o ./build/mjanssen.html --mathjax -c css/base.css -c css/extra.css -c "css/print.css" -c "css/superfish.css" -c "css/superfish-vertical.css" -c "css/base_mode.css"
    - pandoc --standalone ./build/mlindner.md -o ./build/mlindner.html --mathjax -c css/base.css -c css/extra.css -c "css/print.css" -c "css/superfish.css" -c "css/superfish-vertical.css" -c "css/base_mode.css"
    - pandoc --standalone ./build/mschulte.md -o ./build/mschulte.html --mathjax -c css/base.css -c css/extra.css -c "css/print.css" -c "css/superfish.css" -c "css/superfish-vertical.css" -c "css/base_mode.css"
    - pandoc --standalone ./build/mwolkner.md -o ./build/mwolkner.html --mathjax -c css/base.css -c css/extra.css -c "css/print.css" -c "css/superfish.css" -c "css/superfish-vertical.css" -c "css/base_mode.css"
    - pandoc --standalone ./build/pbaasch.md -o ./build/pbaasch.html --mathjax -c css/base.css -c css/extra.css -c "css/print.css" -c "css/superfish.css" -c "css/superfish-vertical.css" -c "css/base_mode.css"
    - pandoc --standalone ./build/pgupta.md -o ./build/pgupta.html --mathjax -c css/base.css -c css/extra.css -c "css/print.css" -c "css/superfish.css" -c "css/superfish-vertical.css" -c "css/base_mode.css"
    - pandoc --standalone ./build/rbeddig.md -o ./build/rbeddig.html --mathjax -c css/base.css -c css/extra.css -c "css/print.css" -c "css/superfish.css" -c "css/superfish-vertical.css" -c "css/base_mode.css"
    - pandoc --standalone ./build/rukena.md -o ./build/rukena.html --mathjax -c css/base.css -c css/extra.css -c "css/print.css" -c "css/superfish.css" -c "css/superfish-vertical.css" -c "css/base_mode.css"
    - pandoc --standalone ./build/sgoetschel.md -o ./build/sgoetschel.html --mathjax -c css/base.css -c css/extra.css -c "css/print.css" -c "css/superfish.css" -c "css/superfish-vertical.css" -c "css/base_mode.css"
    - pandoc --standalone ./build/sleborne.md -o ./build/sleborne.html --mathjax -c css/base.css -c css/extra.css -c "css/print.css" -c "css/superfish.css" -c "css/superfish-vertical.css" -c "css/base_mode.css"
    - pandoc --standalone ./build/sotten.md -o ./build/sotten.html --mathjax -c css/base.css -c css/extra.css -c "css/print.css" -c "css/superfish.css" -c "css/superfish-vertical.css" -c "css/base_mode.css"
    - pandoc --standalone ./build/tsaathoff.md -o ./build/tsaathoff.html --mathjax -c css/base.css -c css/extra.css -c "css/print.css" -c "css/superfish.css" -c "css/superfish-vertical.css" -c "css/base_mode.css"
    - pandoc --standalone ./build/vgriem.md -o ./build/vgriem.html --mathjax -c css/base.css -c css/extra.css -c "css/print.css" -c "css/superfish.css" -c "css/superfish-vertical.css" -c "css/base_mode.css"
    - pandoc --standalone ./build/vtrapp.md -o ./build/vtrapp.html --mathjax -c css/base.css -c css/extra.css -c "css/print.css" -c "css/superfish.css" -c "css/superfish-vertical.css" -c "css/base_mode.css"
    - pandoc --standalone ./build/wleinen.md -o ./build/wleinen.html --mathjax -c css/base.css -c css/extra.css -c "css/print.css" -c "css/superfish.css" -c "css/superfish-vertical.css" -c "css/base_mode.css"
    - pandoc --standalone ./build/wmackens.md -o ./build/wmackens.html --mathjax -c css/base.css -c css/extra.css -c "css/print.css" -c "css/superfish.css" -c "css/superfish-vertical.css" -c "css/base_mode.css"
    - pandoc --standalone ./build/ymogge.md -o ./build/ymogge.html --mathjax -c css/base.css -c css/extra.css -c "css/print.css" -c "css/superfish.css" -c "css/superfish-vertical.css" -c "css/base_mode.css"
  artifacts:
    paths:
      - build/*.html

pages:
  stage: deploy
  script:
    - mkdir .public
    - cp -r build/*.html .public
    - cp -r img .public/.
    - cp -r css .public/.
    - mv .public public
  artifacts:
    paths:
      - public
  rules:
    - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
