Include documentation for multiple project versions in a single GitLab page
Project description
gitlab-versioned-pages
Include documentation for multiple project versions in a single GitLab page.
Overview
Use the following stage in your .gitlab-ci.yml
file to collect documentations for all tagged versions and include them in a single page.
pages:
stage: custom
before_script:
- pip install gitlab_versioned_pages
script:
- mkdir -p ./public
- python -m gitlab_versioned_pages
--project-id ${CI_PROJECT_ID}
--job-name docs
--private-token ${CI_DOCS_TOKEN}
--output-dir ./public
--url "https://${CI_PROJECT_NAMESPACE}.gitlab.io"
artifacts:
paths:
- public
only:
variables:
- $UPDATE_PAGES
Notes
This file creates a ./public
folder containing documentation created for multiple versions (tags) of this repository.
When the repository is public, our job is easy: we simply download the artifact.zip
file from a publicly-accessible URL (see: downloading the latest artifacts). However, when the repository is private, using the above-mentioned URL does not work (see: gitlab-org/gitlab-ce#22957). In that case, we resort to using the GitLab API instead.
If gitlab-org/gitlab-ce#22957 is ever fixed, we would be able to specify
--header "Private-Token: XXXXX"
or attach &private_token=XXXXX
to the query string,
and keep using the original URL:
curl --header "Private-Token: XXXXX" \
"https://gitlab.com/user/repo/-/jobs/artifacts/ref/download?job=job_name"
Good resource: https://docs.gitlab.com/ee/api/jobs.html#download-the-artifacts-archive.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for gitlab-versioned-pages-0.1.3.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | e1665fb01a9b123df67f784d0a598903a1b2a6d85e45072c72e8e1db9f109590 |
|
MD5 | 665576b22b6d9d80fd2458d0a38c6b23 |
|
BLAKE2b-256 | 1de267e4911d943dc75e3a91d654d6e0373d377e6847c2b0beb7c57899b08b6d |
Hashes for gitlab_versioned_pages-0.1.3-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4f1ff99f5a257716b4871305c82b8855801a96c3992be85a5e6e454917d0ff8e |
|
MD5 | 852822407921478473c70f5a93fccbe8 |
|
BLAKE2b-256 | 1dc47a667f856019f78ba5647ca47b918293170295d4b89b4c407365229c3545 |