Skip to content
Snippets Groups Projects
Verified Commit e016ae60 authored by Karel van Klink's avatar Karel van Klink :smiley_cat:
Browse files

Update CI

parent 40bd8735
No related branches found
No related tags found
1 merge request!316Replace Sphinx with MkDocs
...@@ -4,8 +4,8 @@ stages: ...@@ -4,8 +4,8 @@ stages:
- documentation - documentation
- sonarqube - sonarqube
- trigger_jenkins_build - trigger_jenkins_build
- publish-prod-1 - publish-docs-prod-1
- publish-prod-2 - publish-docs-prod-2
#################################### tox - Testing and linting #################################### tox - Testing and linting
run-tox-pipeline: run-tox-pipeline:
...@@ -50,16 +50,16 @@ build-documentation: ...@@ -50,16 +50,16 @@ build-documentation:
stage: documentation stage: documentation
tags: tags:
- docker-executor - docker-executor
image: python:latest image: python:3.12
before_script: before_script:
- cd $CI_PROJECT_DIR/docs - cd $CI_PROJECT_DIR/docs
script: script:
- build-docs.sh - /bin/sh ./build-docs.sh
artifacts: artifacts:
paths: paths:
- public - docs/public
##### Vale - Documentation linter ##### Vale - Documentation linter
lint-documentation: lint-documentation:
...@@ -82,40 +82,33 @@ lint-documentation: ...@@ -82,40 +82,33 @@ lint-documentation:
- vale --glob='!*/migrations/*' $CI_PROJECT_DIR/docs/ $CI_PROJECT_DIR/gso/ - vale --glob='!*/migrations/*' $CI_PROJECT_DIR/docs/ $CI_PROJECT_DIR/gso/
##### Publish documentation artefacts ##### Publish documentation artefacts
publish-prod-2: publish-docs-prod-1:
stage: publish-prod-2 stage: publish-docs-prod-1
# First deploy to prod-2 # First deploy to prod-1
tags: tags:
- gap-docs-prod-2 - gap-docs-prod-1
only: only:
refs: - master # Only publish when on the main branch
- main # Only publish when on the main branch
needs: needs:
- job: build-documentation - job: build-documentation
artifacts: true artifacts: true
script: script:
- rm -rf /var/www/gap-docs/* - rm -rf /var/www/gap-docs/*
- mv $CI_PROJECT_DIR/public/* /var/www/gap-docs/ - mv $CI_PROJECT_DIR/docs/public/* /var/www/gap-docs/
publish-prod-1: publish-docs-prod-2:
stage: publish-prod-1 stage: publish-docs-prod-2
# When successful, also deploy to prod-1 # When successful, also deploy to prod-2
tags: tags:
- gap-docs-prod-1 - gap-docs-prod-2
only: only:
refs: - master # Only publish when on the main branch
- main # Only publish when on the main branch
needs: needs:
- job: build-documentation - job: build-documentation
artifacts: true artifacts: true
script: script:
- rm -rf /var/www/gap-docs/* - rm -rf /var/www/gap-docs/*
- mv $CI_PROJECT_DIR/public/* /var/www/gap-docs/ - mv $CI_PROJECT_DIR/docs/public/* /var/www/gap-docs/
sonarqube: sonarqube:
stage: sonarqube stage: sonarqube
......
...@@ -5,7 +5,8 @@ set -o nounset ...@@ -5,7 +5,8 @@ set -o nounset
export OSS_PARAMS_FILENAME=../gso/oss-params-example.json export OSS_PARAMS_FILENAME=../gso/oss-params-example.json
export TESTING=true export TESTING=true
pip install pyyaml mkdocstrings-python mkdocs_gen_files mkdocs-material mkdocs-literate-nav mkdocs-redirects
pip install -e ..
python ./scripts/gen_wf_redirects.py python ./scripts/gen_wf_redirects.py
pip install mkdocstrings-python mkdocs_gen_files mkdocs-material mkdocs-literate-nav mkdocs-redirects
mkdocs build --site-dir public mkdocs build --site-dir public
...@@ -25,7 +25,7 @@ for path in sorted(src.rglob("*.py")): ...@@ -25,7 +25,7 @@ for path in sorted(src.rglob("*.py")):
if len(parts) == 4 and "workflows" in parts: # noqa: PLR2004 if len(parts) == 4 and "workflows" in parts: # noqa: PLR2004
redirect_map["workflow/" + parts[3] + "/index.md"] = "https://docs.gap.geant.org/reference/" + "/".join(parts) redirect_map["workflow/" + parts[3] + "/index.md"] = "https://docs.gap.geant.org/reference/" + "/".join(parts)
with Path.open(root / "wf_redirects.yaml", "w") as redirect_file: with Path.open(root / "docs" / "wf_redirects.yaml", "w") as redirect_file:
file_content = { file_content = {
"plugins": [ "plugins": [
"search", "search",
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment