GitLab CI/CD

tutorial

Job templates

In addition to the mender-ci-tools Docker image, Mender provides job templates for uploading Mender Artifacts and creating deployments to a group of devices.

The jobs use Personal Access Tokens feature which is only available in Mender Server version 3.4 or newer.

In this chapter we introduce the different jobs and provide examples on how to use them.

Upload a Mender Artifact job

.mender:upload:artifact job template uploads a Mender Artifact to a Mender Server.

Create a deployment job

.mender:create:deployment job template creates a deployment on a Mender Server.

Setup

The job templates require the following CI variable to be set in the repository settings:

Make sure to protect the variable accordingly.

Pipelines examples

Build and deploy a Mender Artifact

@build-and-deploy-mender-artifact.gitlab-ci.yml@ # https://github.com/mendersoftware/mender-ci-workflows/tree/1.0.0/examples/gitlab/build-and-deploy-mender-artifact.gitlab-ci.yml

Build and deploy multiple Mender Artifacts

@build-two-artifacts.gitlab-ci.yml@ # https://github.com/mendersoftware/mender-ci-workflows/tree/1.0.0/examples/gitlab/build-two-artifacts.gitlab-ci.yml

Build and deploy a Mender Artifact to a single device

@deploy-to-a-single-device.gitlab-ci.yml@ # https://github.com/mendersoftware/mender-ci-workflows/tree/1.0.0/examples/gitlab/deploy-to-a-single-device.gitlab-ci.yml

We welcome contributions to improve this documentation. To submit a change, use the Edit link at the top of the page or email us at .