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

Werf uses following values for werf environment variables:

WERF_IMAGES_REPO

WERF_IMAGES_REPO value is taken from CI_REGISTRY_IMAGE gitlab environment variable.

WERF_TAG_GIT_TAG

WERF_TAG_GIT_TAG value is taken from CI_COMMIT_TAG gitlab environment variable.

WERF_TAG_GIT_BRANCH

WERF_TAG_GIT_BRANCH value is taken from CI_COMMIT_REF_NAME gitlab environment variable.

WERF_ADD_ANNOTATION_PROJECT_GIT

WERF_ADD_ANNOTATION_PROJECT_GIT value is taken from CI_PROJECT_URL gitlab environment variable and constructed as:

project.werf.io/git=$CI_PROJECT_URL

WERF_ADD_ANNOTATION_CI_COMMIT

WERF_ADD_ANNOTATION_CI_COMMIT value is taken from CI_COMMIT_SHA gitlab environment variable and constructed as:

ci.werf.io/commit=$CI_COMMIT_SHA

WERF_ADD_ANNOTATION_GITLAB_CI_PIPELINE_URL

WERF_ADD_ANNOTATION_GITLAB_CI_PIPELINE_URL value is taken from CI_PIPELINE_ID gitlab environment variable and constructed as:

gitlab.ci.werf.io/pipeline-url=$CI_PROJECT_URL/pipelines/$CI_PIPELINE_ID

WERF_ADD_ANNOTATION_GITLAB_CI_JOB_URL

WERF_ADD_ANNOTATION_GITLAB_CI_JOB_URL value is taken from CI_JOB_ID gitlab environment variable and constructed as:

gitlab.ci.werf.io/job-url=$CI_PROJECT_URL/-/jobs/$CI_JOB_ID

WERF_ENV

GitLab has environments support. Werf will detect current environment for the pipeline in gitlab and use it as environment parameter.

WERF_ENV value is taken from CI_ENVIRONMENT_SLUG gitlab environment variable.

Other variables

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

How to use

GitLab CI is turned on in werf ci-env command by required positional argument:

werf ci-env gitlab --tagging-strategy ...