Skip to content
Snippets Groups Projects
.gitlab-ci.yml 4.63 KiB
stages:
  - test
  - build
  - deploy
  - after_test

variables:
    PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache/pip"

docs:
  stage: test
  image: it4innovations/docker-mdcheck:latest
  allow_failure: true
  script:
  - find content/docs -name "*.mdx" | xargs mdl -r ~MD002,~MD007,~MD013,~MD010,~MD014,~MD024,~MD026,~MD029,~MD033,~MD036,~MD037,~MD046

pylint:
  stage: test
  image: it4innovations/docker-pycheck:latest
  before_script:
  - source /opt/.venv3/bin/activate
  script:
  - pylint $(find . -name "*.py" -not -name "feslicescript.py")

capitalize:
  stage: test
  image: it4innovations/docker-mkdocscheck:latest
  allow_failure: true
  before_script:
  - source /opt/.venv3/bin/activate
  - python -V # debug
  - pip list | grep titlecase 
  script:
  - find content/docs/ \( -name '*.mdx' -o -name '*.yml' \) ! -path '*einfracz*' -print0 | xargs -0 -n1 scripts/titlemd.py --test

ext_links:
  stage: after_test
  image: it4innovations/docker-mdcheck:latest
  allow_failure: true
  after_script:
  # remove JSON results
  - rm *.json
  script:
  - find content/docs -name '*.mdx' -exec grep --color -l http {} + | xargs awesome_bot -t 10 --allow-dupe --allow-redirect
  only:
  - master

404s:
  stage: after_test
  image: it4innovations/docker-mkdocscheck:latest
  before_script:
  - echo "192.168.101.10 docs.it4i.cz" >> /etc/hosts
  - wget -V
  - echo https://docs.it4i.cz/devel/$CI_COMMIT_REF_NAME/
  - wget --spider -e robots=off -o wget.log -r -p https://docs.it4i.cz/devel/$CI_COMMIT_REF_NAME/ || true
  script:
  - cat wget.log | awk '/^Found [0-9]+ broken link[s]?.$/,/FINISHED/ { rc=-1; print $0 }; END { exit rc }'

mkdocs:
  stage: build
  image: it4innovations/docker-mkdocscheck:latest
  before_script:
  - source /opt/.venv3/bin/activate
  - python -V # debug
  - pip install -r requirements.txt
  - pip freeze # debug
  - mkdocs -V # debug
  script:
    # add version to footer
  - bash scripts/add_version.sh