Commit d00448b0 authored by René Schöne's avatar René Schöne
Browse files

Use mike for versioned documentation

parent 1cdde588
Pipeline #11937 passed with stages
in 8 minutes and 41 seconds
......@@ -90,18 +90,31 @@ ragdoc_view:
- "pages/docs/ragdoc"
pages:
image: python:3.8-buster
image: python:3.10.0-bullseye
stage: publish
needs:
- ragdoc_view
- test
variables:
PAGES_BRANCH: pages
HTTPS_REMOTE: https://${PROJECT_BOT_USER}:${PROJECT_BOT_TOKEN}@${CI_SERVER_HOST}/${CI_PROJECT_PATH}.git
before_script:
- pip install -U mkdocs mkdocs-macros-plugin mkdocs-git-revision-date-localized-plugin
- pip install -r pages/requirements.txt
- git config user.name $PROJECT_BOT_USER
- git config user.email $PROJECT_BOT_USER@git-st.inf.tu-dresden.de
- git fetch origin $PAGES_BRANCH || echo "Pages branch not deployed yet."
- git checkout $CI_COMMIT_SHA
script:
- cd pages && mkdocs build
- cd pages
- export VERSION=$(python main.py)
- echo $VERSION
- mike list --json --prefix public -r $HTTPS_REMOTE -b $PAGES_BRANCH
- mike deploy --rebase --prefix public -r $HTTPS_REMOTE -p -b $PAGES_BRANCH --update-aliases $VERSION
- cd ..
- git checkout $PAGES_BRANCH -- public/
artifacts:
paths:
- public/
only:
- dev
- master
artifacts:
paths:
- public
import os
ragconnectVersionFileName = '../ragconnect.base/src/main/resources/ragConnectVersion.properties'
def get_version():
if os.environ.get('CI_COMMIT_BRANCH', 'unknown') == 'dev':
return 'dev'
with open(ragconnectVersionFileName) as ragconnectVersionFile:
versionFileContent = ragconnectVersionFile.read()
return versionFileContent[versionFileContent.rindex('version=') + 8:].strip()
......
mkdocs==1.2.2
mkdocs-git-revision-date-localized-plugin==0.10.3
mkdocs-macros-plugin==0.6.3
mike==1.1.2
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment