
---
stages:
  - typeset

variables:
  GIT_SUBMODULE_STRATEGY: recursive


design_specifications:
  stage: typeset
  image: registry.gitlab.com/silkeh/latex:latest
  script:
    - cp misc/preamble.tex specifications/system/preamble.tex
    - cd specifications/system/
    - latexmk -xelatex document.tex
    - mv document.pdf ../../design_specifications.pdf
  artifacts:
    paths:
      - design_specifications.pdf
  only:
    refs:
      - web
      - branches
      - tags
    changes:
      - specifications/system/*
      - misc/preamble.tex

initial_design:
  stage: typeset
  image: pandoc/latex:latest
  script:
    - cd initial_design
    - pandoc initial_design.md -o initial_design.pdf
    - pandoc exploration/design_space_exploration.md -o design_space_exploration.pdf
  artifacts:
    paths:
      - initial_design/initial_design.pdf
      - initial_design/design_space_exploration.pdf
  only:
    refs:
      - web
      - branches
      - tags
    changes:
      - initial_design/*

feature_definition:
  stage: typeset
  image: registry.gitlab.com/silkeh/latex:latest
  script:
    - apk update; apk add make
    - cd features/
    - make
    - mv feature_definition.pdf ../feature_definition.pdf
  artifacts:
    paths:
      - feature_definition.pdf
  only:
    refs:
      - web
      - branches
      - tags
    changes:
      - features/*

feature_selection:
  stage: typeset
  image: pandoc/latex:latest
  script:
    - pandoc feature_selection/selection.md $(ls feature_selection/*-iteration.md) -o feature_selection.pdf
  artifacts:
    paths:
      - feature_selection.pdf
  only:
    refs:
      - web
      - branches
      - tags
    changes:
      - feature_selection/*
