Add CI variable for CI_SERVER_URL
Summary
A Pipeline Job that needs to use the GitLab API (to download an artifact, for example) doesn't have access to the base GitLab URL (CI_SERVER_URL
?). There's CI_PROJECT_URL
and CI_REPOSITORY_URL
, but these are very specific.
Steps to reproduce
Turn on debug tracing and look at the list of CI_XXX
variables.
Example Project
n/a
What is the current bug behavior?
There is no base GitLab URL.
What is the expected correct behavior?
Having something like CI_SERVER_URL
would be very useful.
Relevant logs and/or screenshots
The gitlab-runner seems to have a notion of a CI_SERVER_URL
in its (possibly out-of-date) help:
gitlab-runner artifacts-downloader --help
NAME:
gitlab-runner artifacts-downloader - download and extract build artifacts (internal)
USAGE:
gitlab-runner artifacts-downloader [command options] [arguments...]
OPTIONS:
--id value The build ID to upload artifacts for (default: "0") [$CI_JOB_ID]
--token value Build token [$CI_JOB_TOKEN]
--url value GitLab CI URL [$CI_SERVER_URL]
--tls-ca-file value File containing the certificates to verify the peer when using HTTPS [$CI_SERVER_TLS_CA_FILE]
--tls-cert-file value File containing certificate for TLS client auth with runner when using HTTPS [$CI_SERVER_TLS_CERT_FILE]
--tls-key-file value File containing private key for TLS client auth with runner when using HTTPS [$CI_SERVER_TLS_KEY_FILE]
--retry value How many times to retry upload (default: "2")
--retry-time value How long to wait between retries (default: "1s")
Output of checks
n/a
Results of GitLab environment info
n/a
Results of GitLab application Check
n/a
Possible fixes
Edited by Mark Fletcher