Skip to content

Commit

Permalink
Doc: make sphinx-multiversion play nicely with gitlab-ci
Browse files Browse the repository at this point in the history
We need to add back the correct remote to let sphinx-multiversion do its job.

Also for some reasons, "git describe" doesn't work in gitlab-ci, so
let's use git tag --list | tail instead
  • Loading branch information
autra committed Jul 3, 2020
1 parent 144e17a commit deacf63
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
5 changes: 4 additions & 1 deletion .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,12 @@ pages:
script:
- pip install .
- pip install .[doc]
# sphinx-multiversion needs to have all the branches
- git remote add upstream https://gitlab.com/Oslandia/py3dtiles.git
- git fetch upstream
- sphinx-multiversion docs public
- cp -rv docs/index_redirect.html public/index.html
- current_version="$(git describe --tags --abbrev=0)"
- current_version="$(git tag --list | tail -n1)"
- sed -i "s/VERSION/$current_version/g" public/index.html
artifacts:
paths:
Expand Down
3 changes: 2 additions & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,8 @@
smv_branch_whitelist = r'^master$'

# Whitelist pattern for remotes (set to None to use local branches only)
smv_remote_whitelist = None
# set to upstream because we add this remote for gitlab, see .gitlab-ci.yml
smv_remote_whitelist = r'^upstream|origin$'

# Pattern for released versions
smv_released_pattern = r'^tags/.*$'
Expand Down

0 comments on commit deacf63

Please sign in to comment.