Skip to content

Add Gitlab-Pages related predefined CI variables

Description

Currently, there is no way to make a truly generic .gitlab-ci.yml for a gitlab-pages deployment if the configuration wants to know the prefix (for example, see Frozen-Flask's FREEZER_BASE_URL).

We could allow for more flexibility in the build and deploy steps by adding a few predefined CI variables. This would be convenient for people that want their ci configuration to work with multiple (hosted in different places) gitlab / pages installs.

This can also be achieved by using relative urls and setting a base url (such as in the Middleman example configuration), however it is conceivable that using relative urls won't be available, or at least won't be preferred. For example, with Frozen-Flask, doing so will append a visible index.html to URLs that would otherwise end with /.

It is also conceivable one may want to generate links for generated content (think code coverage SVGs for putting in READMEs), which allows to generalize that as well (as well as any other general link expected to be used externally).

gitlab-ce14213 gitlab-ce19173

Proposal

Add the following predefined variables to CI (naming convention inspired by CI_REGISTRY*):

  • CI_PAGES (e.g gitlab.io)
  • CI_PAGES_URL (defined as, for example $CI_PROJECT_NAMESPACE.$CI_PAGES/$CI_PROJECT_NAME, with a special case for $CI_PROJECT_NAME == $CI_PROJECT_NAMESPACE.$CI_PAGES)

Links / references