Skip to main content

Include documentation for multiple project versions in a single GitLab page

Project description

gitlab-versioned-pages

conda docs pipeline status coverage report

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

gitlab-versioned-pages-0.1.3.tar.gz (17.3 kB view details)

Uploaded Source

Built Distribution

gitlab_versioned_pages-0.1.3-py2.py3-none-any.whl (8.1 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file gitlab-versioned-pages-0.1.3.tar.gz.

File metadata

  • Download URL: gitlab-versioned-pages-0.1.3.tar.gz
  • Upload date:
  • Size: 17.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/49.6.0.post20210108 requests-toolbelt/0.9.1 tqdm/4.56.2 CPython/3.8.6

File hashes

Hashes for gitlab-versioned-pages-0.1.3.tar.gz
Algorithm Hash digest
SHA256 e1665fb01a9b123df67f784d0a598903a1b2a6d85e45072c72e8e1db9f109590
MD5 665576b22b6d9d80fd2458d0a38c6b23
BLAKE2b-256 1de267e4911d943dc75e3a91d654d6e0373d377e6847c2b0beb7c57899b08b6d

See more details on using hashes here.

File details

Details for the file gitlab_versioned_pages-0.1.3-py2.py3-none-any.whl.

File metadata

  • Download URL: gitlab_versioned_pages-0.1.3-py2.py3-none-any.whl
  • Upload date:
  • Size: 8.1 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/49.6.0.post20210108 requests-toolbelt/0.9.1 tqdm/4.56.2 CPython/3.8.6

File hashes

Hashes for gitlab_versioned_pages-0.1.3-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 4f1ff99f5a257716b4871305c82b8855801a96c3992be85a5e6e454917d0ff8e
MD5 852822407921478473c70f5a93fccbe8
BLAKE2b-256 1dc47a667f856019f78ba5647ca47b918293170295d4b89b4c407365229c3545

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page