Conan#

This is a “sub-pipeline” for building, testing and deploying conan packages.

Triggers#

All jobs from docker pipeline stages are triggered only if changes have been made to conan recipe related files. Right now such files are detected by these patterns:

  • conandata.yml,

  • conanfile.py.

See also: Conan packages in the GitLab Package Registry.

Jobs overview#

build:conan#

This stage is responsible for building conan packages from a clean state to make sure there are no unexpected results.

ALLOW FAILURE

Job is not allowed to fail as any failure here means fundamental problems in a specific conan recipe.

ARTIFACTS

Job doesn’t generate any artifacts.

DEPENDENCIES

Job doesn’t require artifacts from other jobs and has no dependencies from other stages or jobs.

ENVIRONMENT

Name

Necessity

Origin

BPROTO_CI_DEPLOY_USER

Mandatory

BPROTO_CI_DEPLOY_TOKEN

Mandatory

BPROTO_CI_CONAN_PACKAGE_NAME

Mandatory

BPROTO_CI_CONAN_PACKAGES_REGISTRY

Mandatory

CI_COMMIT_REF_NAME

Mandatory

GitLab

CI_DEFAULT_BRANCH

Mandatory

GitLab

CI_PROJECT_ROOT_NAMESPACE

Mandatory

GitLab

IMAGES

conan:latest.

STAGE

Build stage.

TRIGGERS

Job is triggered only on merge requests when any file from trigger list is changed.

deploy:conan#

This stage is responsible for deploying conan packages to the package registry defined in gitlab remote (which should usually be equal to BPROTO_CI_CONAN_PACKAGES_REGISTRY environment variable).

ALLOW FAILURE

Job is not allowed to fail as these jobs are run only on CI_DEFAULT_BRANCH after accepting a successful merge request!

ARTIFACTS

New conan package will be deployed to the project package registry.

DEPENDENCIES

Job doesn’t generate any artifacts.

ENVIRONMENT

Name

Necessity

Origin

BPROTO_CI_DEPLOY_USER

Mandatory

BPROTO_CI_DEPLOY_TOKEN

Mandatory

BPROTO_CI_CONAN_PACKAGE_NAME

Mandatory

BPROTO_CI_CONAN_PACKAGES_REGISTRY

Mandatory

CI_COMMIT_REF_NAME

Mandatory

GitLab

CI_DEFAULT_BRANCH

Mandatory

GitLab

CI_PROJECT_ROOT_NAMESPACE

Mandatory

GitLab

IMAGES

conan:latest.

STAGE

Deploy stage.

TRIGGERS

Job is triggered only on CI_DEFAULT_BRANCH when any file from trigger list is changed.

Usage#

To correctly use provided CI jobs you need to set BPROTO_CI_CONAN_PACKAGES_REGISTRY either in project CI/CD settings or as shown below.

variables:
  BPROTO_CI_CONAN_PACKAGE_NAME: "test_package"

include:
  - project: 'bproto/cicd'
    ref: main
    file:
      - '/.gitlab/ci/external/conan.yml'