Only set GitLab Pages variable if GitLab Pages is enabled on that project

Problem to solve

Follow up to the comment on https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/24504#note_136193341

If GitLab Pages are disabled for the project, then GiaLab Pages related variables shouldn't be set during a build.

Target audience

  • Sasha, Software Developer, https://design.gitlab.com/research/personas#persona-sasha

Further details

This is a feature that was requested after https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/24504 was merged.

Proposal

Figure out how to detect is GitLab Pages are enabled, and then only set the GitLab Pages environment variables.

What does success look like, and how can we measure that?

If GitLab Pages is enabled: environment variables CI_PAGES_DOMAIN and CI_PAGES_URL exist If GitLab Pages is disabled: environment variables CI_PAGES_DOMAIN and CI_PAGES_URL do not exist

Links / references

Assignee Loading
Time tracking Loading