gcip2.pipeline_vars

Classes

Predefined(*values)

PredefinedExternalPullRequest(*values)

PredefinedMergeRequest(*values)

VarEnum(new_class_name, /, names, *[, ...])

class gcip2.pipeline_vars.VarEnum(new_class_name, /, names, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]

Bases: str, Enum

getenv(default=None)[source]
Parameters:

default (T | None)

Return type:

T | str | None

must()[source]
Return type:

str

class gcip2.pipeline_vars.Predefined(*values)[source]

Bases: VarEnum, Enum

CHAT_CHANNEL = '1'

The Source chat channel that triggered the ChatOps command.

CHAT_INPUT = '2'

The additional arguments passed with the ChatOps command.

CHAT_USER_ID = '3'

The chat service’s user ID of the user who triggered the ChatOps command.

CI = '4'

Available for all jobs executed in CI/CD. true when available.

CI_API_V4_URL = '5'

The GitLab API v4 root URL.

CI_API_GRAPHQL_URL = '6'

The GitLab API GraphQL root URL.

CI_BUILD_NETWORK_NAME = '7'

The name of the network that the job created. Available only with the Docker executor when FF_NETWORK_PER_BUILD

CI_BUILDS_DIR = '8'

The top-level directory where builds are executed.

CI_COMMIT_AUTHOR = '9'

The author of the commit in Name <email> format.

CI_COMMIT_BEFORE_SHA = '10'

The previous latest commit present on a branch or tag. It is always 0000000000000000000000000000000000000000 for

CI_COMMIT_BRANCH = '11'

The commit branch name. Available in branch pipelines, including pipelines for the default branch.

CI_COMMIT_DEFAULT_BRANCH_BASE_SHA = '12'

The merge base between CI_COMMIT_SHA and the default branch. Available only in non-default branch pipelines.

CI_COMMIT_DESCRIPTION = '13'

The description of the commit. If the title is shorter than 100 characters, the description is the

CI_COMMIT_MESSAGE = '14'

The full commit message.

CI_COMMIT_MESSAGE_IS_TRUNCATED = '15'

true if CI_COMMIT_MESSAGE is truncated to the size specified in the GITLAB_CI_MAX_COMMIT_MESSAGE_SIZE_IN_BYTES

CI_COMMIT_REF_NAME = '16'

The branch or tag name for which project is built.

CI_COMMIT_REF_PROTECTED = '17'

true if the job is running for a protected reference, false otherwise.

CI_COMMIT_REF_SLUG = '18'

CI_COMMIT_REF_NAME in lowercase, shortened to 63 bytes, and with everything except 0-9 and a-z replaced

CI_COMMIT_SHA = '19'

The commit revision the project is built for.

CI_COMMIT_SHORT_SHA = '20'

The first eight characters of CI_COMMIT_SHA.

CI_COMMIT_TAG = '21'

The commit tag name. Available only in pipelines for tags.

CI_COMMIT_TAG_MESSAGE = '22'

The commit tag message. Available only in pipelines for tags.

CI_COMMIT_TIMESTAMP = '23'

55Z. UTC by default.

Type:

The timestamp of the commit in the ISO 8601 format. For example, 2022-01-31T16

Type:

47

CI_COMMIT_TITLE = '24'

The title of the commit. The full first line of the message.

CI_COMMIT_USER_LOGIN = '25'

The GitLab username of the commit author if the author’s profile and email are public and match the commit email,

CI_CONCURRENT_ID = '26'

The unique ID of build execution in a single executor.

CI_CONCURRENT_PROJECT_ID = '27'

The unique ID of build execution in a single executor and project.

CI_CONFIG_PATH = '28'

The path to the CI/CD configuration file. Defaults to .gitlab-ci.yml.

CI_CONFIG_REF_URI = '29'

The fully qualified ref path to the top-level pipeline definition, for example

CI_DEBUG_TRACE = '30'

true if debug logging (tracing) is enabled.

CI_DEBUG_SERVICES = '31'

true if service container logging is enabled.

CI_DEFAULT_BRANCH = '32'

The name of the project’s default branch.

CI_DEFAULT_BRANCH_SLUG = '33'

CI_DEFAULT_BRANCH in lowercase, shortened to 63 bytes, and with everything except 0-9 and a-z replaced

CI_DEPENDENCY_PROXY_DIRECT_GROUP_IMAGE_PREFIX = '34'

The direct group image prefix for pulling images through the Dependency Proxy.

CI_DEPENDENCY_PROXY_GROUP_IMAGE_PREFIX = '35'

The top-level group image prefix for pulling images through the Dependency Proxy.

CI_DEPENDENCY_PROXY_PASSWORD = '36'

The password to pull images through the Dependency Proxy.

CI_DEPENDENCY_PROXY_SERVER = '37'

$CI_SERVER_PORT.

Type:

The server for logging in to the Dependency Proxy. This variable is equivalent to $CI_SERVER_HOST

CI_DEPENDENCY_PROXY_USER = '38'

The username to pull images through the Dependency Proxy.

CI_DEPLOY_FREEZE = '39'

Only available if the pipeline runs during a deploy freeze window. true when available.

CI_DEPLOY_PASSWORD = '40'

The authentication password of the GitLab Deploy Token, if the project has one.

CI_DEPLOY_USER = '41'

The authentication username of the GitLab Deploy Token, if the project has one.

CI_DISPOSABLE_ENVIRONMENT = '42'

Only available if the job is executed in a disposable environment (something that is created only for this

CI_ENVIRONMENT_ID = '43'

name is set.

Type:

The ID of the environment for this job. Available if environment

CI_ENVIRONMENT_NAME = '44'

name is set.

Type:

The name of the environment for this job. Available if environment

CI_ENVIRONMENT_SLUG = '45'

The simplified version of the environment name, suitable for inclusion in DNS, URLs, Kubernetes labels,

CI_ENVIRONMENT_URL = '46'

url is set.

Type:

The URL of the environment for this job. Available if environment

CI_ENVIRONMENT_ACTION = '47'

action is set. Can be start,

Type:

The action annotation specified for this job’s environment. Available if environment

CI_ENVIRONMENT_TIER = '48'

The deployment tier of the environment for this job.

CI_GITLAB_FIPS_MODE = '49'

Only available if FIPS mode is enabled in the GitLab instance. true when available.

CI_HAS_OPEN_REQUIREMENTS = '50'

Only available if the pipeline’s project has an open requirement. true when available.

CI_JOB_GROUP_NAME = '51'

The shared name of a group of jobs, when using either parallel or manually grouped jobs. For example, if the job

CI_JOB_ID = '52'

The internal ID of the job, unique across all jobs in the GitLab instance.

CI_JOB_IMAGE = '53'

The name of the Docker image running the job. Only available when the job explicitly specifies a Docker image.

CI_JOB_MANUAL = '54'

Only available if the job was started manually. true when available.

CI_JOB_NAME = '55'

The name of the job.

CI_JOB_NAME_SLUG = '56'

CI_JOB_NAME in lowercase, shortened to 63 bytes, and with everything except 0-9 and a-z replaced

CI_JOB_STAGE = '57'

The name of the job’s stage.

CI_JOB_STATUS = '58'

The status of the job as each runner stage is executed. Use with after_script.

CI_JOB_TAGS = '59'

A JSON array of the job’s runner tags. For example [“tag_1”, “tag_2”]. Introduced in GitLab 19.3.

CI_JOB_TIMEOUT = '60'

The job timeout, in seconds.

CI_JOB_TOKEN = '61'

A token to authenticate with certain API endpoints. The token is valid as long as the job is running.

CI_JOB_URL = '62'

The job details URL.

CI_JOB_STARTED_AT = '63'

55Z. UTC by default.

Type:

The date and time when a job started, in ISO 8601 format. For example, 2022-01-31T16

Type:

47

CI_JOB_STARTED_AT_SLUG = '64'

CI_JOB_STARTED_AT in lowercase, shortened to 63 characters, and with everything except 0-9 and a-z replaced

CI_KUBERNETES_ACTIVE = '65'

Only available if the pipeline has a Kubernetes cluster available for deployments. true when available.

CI_NODE_INDEX = '66'

The index of the job in the job set. Only available if the job uses parallel.

CI_NODE_TOTAL = '67'

The total number of instances of this job running in parallel. Set to 1 if the job does not use parallel.

CI_OPEN_MERGE_REQUESTS = '68'

A comma-separated list of up to four merge requests that use the current branch and project as the merge request

CI_PAGES_DOMAIN = '69'

The instance’s domain that hosts GitLab Pages, not including the namespace subdomain. To use the full hostname,

CI_PAGES_HOSTNAME = '70'

The full hostname of the Pages deployment.

CI_PAGES_URL = '71'

The URL for a GitLab Pages site. Always a subdomain of CI_PAGES_DOMAIN. In GitLab 17.9 and later, the value

CI_PIPELINE_ID = '72'

The instance-level ID of the current pipeline. This ID is unique across all projects on the GitLab instance.

CI_PIPELINE_IID = '73'

The project-level IID (internal ID) of the current pipeline. This ID is unique only in the current project.

CI_PIPELINE_SOURCE = '74'

How the pipeline was triggered. The value can be one of the pipeline sources.

CI_PIPELINE_TRIGGERED = '75'

true for pipelines triggered with a trigger token. For pipelines triggered with the trigger keyword,

CI_PIPELINE_URL = '76'

The URL for the pipeline details.

CI_PIPELINE_CREATED_AT = '77'

55Z.

Type:

The date and time when the pipeline was created, in ISO 8601 format. For example, 2022-01-31T16

Type:

47

CI_PIPELINE_NAME = '78'

name.

Type:

The pipeline name defined in workflow

CI_PIPELINE_SCHEDULE_DESCRIPTION = '79'

The description of the pipeline schedule. Only available in scheduled pipelines. Introduced in GitLab 17.8.

CI_PROJECT_DIR = '80'

The full path the repository is cloned to, and where the job runs from. If the GitLab Runner builds_dir parameter

CI_PROJECT_ID = '81'

The ID of the current project. This ID is unique across all projects on the GitLab instance.

CI_PROJECT_NAME = '82'

The name of the directory for the project. For example if the project URL is

CI_PROJECT_NAMESPACE = '83'

The project namespace (username or group name) of the job.

CI_PROJECT_NAMESPACE_ID = '84'

The project namespace ID of the job.

CI_PROJECT_NAMESPACE_SLUG = '85'

$CI_PROJECT_NAMESPACE in lowercase, shortened to 63 characters, and with everything except 0-9 and a-z replaced

CI_PROJECT_PATH_SLUG = '86'

$CI_PROJECT_PATH in lowercase, shortened to 63 characters, and with everything except 0-9 and a-z replaced with -.

CI_PROJECT_PATH = '87'

The project namespace with the project name included.

CI_PROJECT_REPOSITORY_LANGUAGES = '88'

A comma-separated, lowercase list of the languages used in the repository. For example ruby,javascript,html,css.

CI_PROJECT_ROOT_NAMESPACE = '89'

The root project namespace (username or group name) of the job. For example, if CI_PROJECT_NAMESPACE is

CI_PROJECT_ROOT_NAMESPACE_SLUG = '90'

$CI_PROJECT_ROOT_NAMESPACE in lowercase, shortened to 63 characters, and with everything except 0-9 and a-z

CI_PROJECT_TITLE = '91'

The human-readable project name as displayed in the GitLab web interface.

CI_PROJECT_DESCRIPTION = '92'

The project description as displayed in the GitLab web interface.

CI_PROJECT_TOPICS = '93'

A comma-separated, lowercase list of topics (limited to the first 20) assigned to the project.

CI_PROJECT_URL = '94'

The HTTP(S) address of the project.

CI_PROJECT_VISIBILITY = '95'

The project visibility. Can be internal, private, or public.

CI_PROJECT_CLASSIFICATION_LABEL = '96'

The project external authorization classification label.

CI_REGISTRY = '97'

registry.gitlab.example.com.

Type:

Address of the container registry server, formatted as <host>[

Type:

<port>]. For example

CI_REGISTRY_IMAGE = '98'

Base address for the container registry to push, pull, or tag project’s images, formatted as

CI_REGISTRY_PASSWORD = '99'

The password to push containers to the GitLab project’s container registry. Only available if the container

CI_REGISTRY_USER = '100'

The username to push containers to the GitLab project’s container registry. Only available if the container

CI_RELEASE_DESCRIPTION = '101'

The description of the release. Available only on pipelines for tags. Description length is limited to first 1024

CI_REPOSITORY_URL = '102'

$CI_JOB_TOKEN@gitlab.example.com/my-group/my-project.git.

Type:

The full path to Git clone (HTTP) the repository with a CI/CD job token, in the format https

Type:

//gitlab-ci-token

CI_RUNNER_DESCRIPTION = '103'

The description of the runner.

CI_RUNNER_EXECUTABLE_ARCH = '104'

The OS/architecture of the GitLab Runner executable. Might not be the same as the environment of the executor.

CI_RUNNER_ID = '105'

The unique ID of the runner being used.

CI_RUNNER_REVISION = '106'

The revision of the runner running the job.

CI_RUNNER_SHORT_TOKEN = '107'

The runner’s unique ID, used to authenticate new job requests. The token contains a prefix, and the first 17

CI_RUNNER_TAGS = '108'

A JSON array of the runner tags configured on the runner that picked up the job. For example [“tag_1”, “tag_2”].

CI_RUNNER_VERSION = '109'

The version of the GitLab Runner running the job.

CI_SERVER_FQDN = '110'
Type:

The fully qualified domain name (FQDN) of the instance. For example gitlab.example.com

CI_SERVER_HOST = '111'

The host of the GitLab instance URL, without protocol or port. For example gitlab.example.com.

CI_SERVER_NAME = '112'

The name of CI/CD server that coordinates jobs.

CI_SERVER_PORT = '113'

The port of the GitLab instance URL, without host or protocol. For example 8080.

CI_SERVER_PROTOCOL = '114'

The protocol of the GitLab instance URL, without host or port. For example https.

CI_SERVER_SHELL_SSH_HOST = '115'

The SSH host of the GitLab instance, used for access to Git repositories through SSH. For example gitlab.com.

CI_SERVER_SHELL_SSH_PORT = '116'

The SSH port of the GitLab instance. For example 22.

CI_SERVER_REVISION = '117'

GitLab revision that schedules jobs.

CI_SERVER_TLS_CA_FILE = '118'

File containing the TLS CA certificate to verify the GitLab server when tls-ca-file set in runner settings.

CI_SERVER_TLS_CERT_FILE = '119'

File containing the TLS certificate to verify the GitLab server when tls-cert-file set in runner settings.

CI_SERVER_TLS_KEY_FILE = '120'

File containing the TLS key to verify the GitLab server when tls-key-file set in runner settings.

CI_SERVER_URL = '121'
Type:

The base URL of the GitLab instance, including protocol and port. For example https

Type:

//gitlab.example.com

CI_SERVER_VERSION_MAJOR = '122'

The major version of the GitLab instance. For example, if the GitLab version is 17.2.1,

CI_SERVER_VERSION_MINOR = '123'

The minor version of the GitLab instance. For example, if the GitLab version is 17.2.1,

CI_SERVER_VERSION_PATCH = '124'

The patch version of the GitLab instance. For example, if the GitLab version is 17.2.1,

CI_SERVER_VERSION = '125'

The full version of the GitLab instance.

CI_SERVER = '126'

Available for all jobs executed in CI/CD. yes when available.

CI_SHARED_ENVIRONMENT = '127'

Only available if the job is executed in a shared environment (something that is persisted across CI/CD

CI_TEMPLATE_REGISTRY_HOST = '128'

The host of the registry used by CI/CD templates. Defaults to registry.gitlab.com.

CI_TRIGGER_SHORT_TOKEN = '129'

First 4 characters of the trigger token of the current job. Only available if the pipeline was triggered with a

CI_UPSTREAM_JOB_ID = '130'

ID of the upstream trigger job that triggered the current pipeline in a multi-project or parent-child pipeline.

CI_UPSTREAM_PIPELINE_ID = '131'

ID of the upstream pipeline that triggered the current pipeline in a multi-project or parent-child pipeline.

CI_UPSTREAM_PROJECT_ID = '132'

ID of the upstream project that triggered the current pipeline in a multi-project or parent-child pipeline.

CI_TRACEPARENT = '133'

A W3C Trace Context traceparent header value for the job, in the format 00-<trace_id>-<span_id>-01. The trace_id

CI_TRACESTATE = '134'

A W3C Trace Context tracestate header value containing GitLab-specific trace metadata.

GITLAB_CI = '135'

Available for all jobs executed in CI/CD. true when available.

GITLAB_FEATURES = '136'

The comma-separated list of licensed features available for the GitLab instance and license.

GITLAB_USER_EMAIL = '137'

The email of the user who started the pipeline, unless the job is a manual job. In manual jobs,

GITLAB_USER_ID = '138'

The numeric ID of the user who started the pipeline, unless the job is a manual job. In manual jobs,

GITLAB_USER_LOGIN = '139'

The unique username of the user who started the pipeline, unless the job is a manual job. In manual jobs,

GITLAB_USER_NAME = '140'

The display name (user-defined Full name in the profile settings) of the user who started the pipeline,

KUBECONFIG = '141'

The path to the kubeconfig file with contexts for every shared agent connection.

TRIGGER_PAYLOAD = '142'

The webhook payload. Only available when a pipeline is triggered with a webhook.

CI_JOB_JWT = '143'
class gcip2.pipeline_vars.PredefinedMergeRequest(*values)[source]

Bases: VarEnum, Enum

CI_MERGE_REQUEST_APPROVED = '1'

Approval status of the merge request. true when merge request approvals is available and

CI_MERGE_REQUEST_ASSIGNEES = '2'

Comma-separated list of usernames of assignees for the merge request.

CI_MERGE_REQUEST_DIFF_BASE_SHA = '3'

The base SHA of the merge request diff.

CI_MERGE_REQUEST_DIFF_ID = '4'

The version of the merge request diff.

CI_MERGE_REQUEST_EVENT_TYPE = '5'

The event type of the merge request. Can be detached, merged_result or merge_train.

CI_MERGE_REQUEST_DESCRIPTION = '6'

The description of the merge request. If the description is more than 2700 characters long,

CI_MERGE_REQUEST_DESCRIPTION_IS_TRUNCATED = '7'

true if CI_MERGE_REQUEST_DESCRIPTION is truncated down to 2700 characters

CI_MERGE_REQUEST_ID = '8'

The instance-level ID of the merge request. The ID is unique across all projects on the GitLab instance.

CI_MERGE_REQUEST_IID = '9'

The project-level IID (internal ID) of the merge request. This ID is unique for the current project,

CI_MERGE_REQUEST_LABELS = '10'

Comma-separated label names of the merge request. Only available if the merge request has at least one label.

CI_MERGE_REQUEST_MILESTONE = '11'

The milestone title of the merge request. Only available if the merge request has a milestone set.

CI_MERGE_REQUEST_PROJECT_ID = '12'

The ID of the project of the merge request.

CI_MERGE_REQUEST_PROJECT_PATH = '13'

The path of the project of the merge request. For example namespace/awesome-project.

CI_MERGE_REQUEST_PROJECT_URL = '14'

3000/namespace/awesome-project.

Type:

The URL of the project of the merge request. For example, http

Type:

//192.168.10.15

CI_MERGE_REQUEST_REF_PATH = '15'

The ref path of the merge request. For example, refs/merge-requests/1/head.

CI_MERGE_REQUEST_SOURCE_BRANCH_NAME = '16'

The source branch name of the merge request.

CI_MERGE_REQUEST_SOURCE_BRANCH_PROTECTED = '17'

true when the source branch of the merge request is protected.

CI_MERGE_REQUEST_SOURCE_BRANCH_SHA = '18'

The HEAD SHA of the source branch of the merge request. The variable is empty in merge request pipelines.

CI_MERGE_REQUEST_SOURCE_PROJECT_ID = '19'

The ID of the source project of the merge request.

CI_MERGE_REQUEST_SOURCE_PROJECT_PATH = '20'

The path of the source project of the merge request.

CI_MERGE_REQUEST_SOURCE_PROJECT_URL = '21'

The URL of the source project of the merge request.

CI_MERGE_REQUEST_SQUASH_ON_MERGE = '22'

true when the squash on merge option is set.

CI_MERGE_REQUEST_TARGET_BRANCH_NAME = '23'

The target branch name of the merge request.

CI_MERGE_REQUEST_TARGET_BRANCH_PROTECTED = '24'

true when the target branch of the merge request is protected.

CI_MERGE_REQUEST_TARGET_BRANCH_SHA = '25'

The HEAD SHA of the target branch of the merge request. The variable is empty in merge request pipelines.

CI_MERGE_REQUEST_TITLE = '26'

The title of the merge request.

CI_MERGE_REQUEST_DRAFT = '27'

true if the merge request is a draft. Introduced in GitLab 17.10.

class gcip2.pipeline_vars.PredefinedExternalPullRequest(*values)[source]

Bases: VarEnum, Enum

CI_EXTERNAL_PULL_REQUEST_IID = '1'

Pull request ID from GitHub.

CI_EXTERNAL_PULL_REQUEST_SOURCE_REPOSITORY = '2'

The source repository name of the pull request.

CI_EXTERNAL_PULL_REQUEST_TARGET_REPOSITORY = '3'

The target repository name of the pull request.

CI_EXTERNAL_PULL_REQUEST_SOURCE_BRANCH_NAME = '4'

The source branch name of the pull request.

CI_EXTERNAL_PULL_REQUEST_SOURCE_BRANCH_SHA = '5'

The HEAD SHA of the source branch of the pull request.

CI_EXTERNAL_PULL_REQUEST_TARGET_BRANCH_NAME = '6'

The target branch name of the pull request.

CI_EXTERNAL_PULL_REQUEST_TARGET_BRANCH_SHA = '7'

The HEAD SHA of the target branch of the pull request.