Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
R
RagConnect
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
JastAdd
RagConnect
Commits
d00448b0
Commit
d00448b0
authored
3 years ago
by
René Schöne
Browse files
Options
Downloads
Patches
Plain Diff
Use mike for versioned documentation
parent
1cdde588
No related branches found
No related tags found
4 merge requests
!39
Version 1.1.0
,
!35
Version 1.0.0
,
!17
Version 0.3.2
,
!16
Resolve "Make documentation multi-versioned"
Pipeline
#11937
passed
3 years ago
Stage: build
Stage: test
Stage: ragdoc_build
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
.gitlab-ci.yml
+19
-6
19 additions, 6 deletions
.gitlab-ci.yml
pages/main.py
+4
-0
4 additions, 0 deletions
pages/main.py
pages/requirements.txt
+4
-0
4 additions, 0 deletions
pages/requirements.txt
with
27 additions
and
6 deletions
.gitlab-ci.yml
+
19
−
6
View file @
d00448b0
...
@@ -90,18 +90,31 @@ ragdoc_view:
...
@@ -90,18 +90,31 @@ ragdoc_view:
-
"
pages/docs/ragdoc"
-
"
pages/docs/ragdoc"
pages
:
pages
:
image
:
python:3.
8-buster
image
:
python:3.
10.0-bullseye
stage
:
publish
stage
:
publish
needs
:
needs
:
-
ragdoc_view
-
ragdoc_view
-
test
-
test
variables
:
PAGES_BRANCH
:
pages
HTTPS_REMOTE
:
https://${PROJECT_BOT_USER}:${PROJECT_BOT_TOKEN}@${CI_SERVER_HOST}/${CI_PROJECT_PATH}.git
before_script
:
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
:
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
:
only
:
-
dev
-
dev
-
master
-
master
artifacts
:
paths
:
-
public
This diff is collapsed.
Click to expand it.
pages/main.py
+
4
−
0
View file @
d00448b0
import
os
ragconnectVersionFileName
=
'
../ragconnect.base/src/main/resources/ragConnectVersion.properties
'
ragconnectVersionFileName
=
'
../ragconnect.base/src/main/resources/ragConnectVersion.properties
'
def
get_version
():
def
get_version
():
if
os
.
environ
.
get
(
'
CI_COMMIT_BRANCH
'
,
'
unknown
'
)
==
'
dev
'
:
return
'
dev
'
with
open
(
ragconnectVersionFileName
)
as
ragconnectVersionFile
:
with
open
(
ragconnectVersionFileName
)
as
ragconnectVersionFile
:
versionFileContent
=
ragconnectVersionFile
.
read
()
versionFileContent
=
ragconnectVersionFile
.
read
()
return
versionFileContent
[
versionFileContent
.
rindex
(
'
version=
'
)
+
8
:].
strip
()
return
versionFileContent
[
versionFileContent
.
rindex
(
'
version=
'
)
+
8
:].
strip
()
...
...
This diff is collapsed.
Click to expand it.
pages/requirements.txt
0 → 100644
+
4
−
0
View file @
d00448b0
mkdocs==1.2.2
mkdocs-git-revision-date-localized-plugin==0.10.3
mkdocs-macros-plugin==0.6.3
mike==1.1.2
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment