According to the description of ci-env command, werf should define a set of WERF_* variables and perform some actions to integrate with the CI/CD system.

werf uses the following values for werf environment variables:


The value of WERF_REPO is derived from the CI_REGISTRY_IMAGE gitlab environment variable: $CI_REGISTRY_IMAGE/werf.


The value of WERF_REPO_IMPLEMENTATION is set together with WERF_REPO when using built-in GitLab Container Registry.


The value of WERF_ADD_ANNOTATION_PROJECT_GIT is based on the CI_PROJECT_URL gitlab environment variable and composed as follows:$CI_PROJECT_URL


The value of WERF_ADD_ANNOTATION_CI_COMMIT is extracted from the CI_COMMIT_SHA gitlab environment variable and composed as follows:$CI_COMMIT_SHA


The value of WERF_ADD_ANNOTATION_GITLAB_CI_PIPELINE_URL is derived from the CI_PIPELINE_ID gitlab environment variable and composed in the following way:$CI_PROJECT_URL/pipelines/$CI_PIPELINE_ID


The value of WERF_ADD_ANNOTATION_GITLAB_CI_JOB_URL is taken from the CI_JOB_ID gitlab environment variable and composed as follows:$CI_PROJECT_URL/-/jobs/$CI_JOB_ID


GitLab supports environments. werf will detect the current environment for the GitLab pipeline and use it as an environment parameter.

The value of WERF_ENV is extracted from the CI_ENVIRONMENT_SLUG gitlab environment variable.

Other variables

Other variables are configured in the regular way described in the overview article:

How to use

You can turn on the integration with GitLab CI by invoking the werf ci-env command with the required positional argument:

werf ci-env gitlab