Add a CI variable containing the FQDN of the GitLab host

Problem to solve

When writing gitlab-ci.yml files it is sometimes necessary to reference the GitLab host itself within a more complex pattern. Currently there is no variable containing just the FQDN of the GitLab host.

Further details

This would help to reduce hard coded variables in gitlab-ci.yml, thus making them more portable across different servers / if a server name changes.

Proposal

Please provide a variable in a CI run that contains just the FQDN of the GitLab host. In the form of export CI_GITLAB_HOST=gitlab.mycompany.lan or similar, you get the idea.

There are variables containing the GitLab hosts FQDN but usually with more around it like the project path or the https:// part. Some examples are CI_REPOSITORY_URL or CI_PROJECT_URL.

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

Having a variable containing only the FQDN of the GitLab host during a CI run.

Links / references

Assignee Loading
Time tracking Loading