GitLab CI
You can use GitLab’s CI in order to run edr
commands in an automated manner.
For example, you can use it to send a data observability report on changes in your dbt project, monitor for data issues periodically and send alerts to your Slack, and much more.
Setup
Profile
edr
requires a dbt connection profile called elementary
that points to your Elementary schema in the warehouse.
More information on that can be found here.
Accordingly, we’ll need to provide the pipeline with that profile.
If you already have a profiles.yml
in your repository, simply add the elementary
profile to it, and make sure the credentials are loaded as variables.
edr
will automatically pick up on the profiles.yml
file.
Alternatively, you can write your profiles.yml
as a whole to a GitLab variable.
Pipeline
In order to setup the Elementary pipeline in your GitLab repository, you’ll need to create a file at the root of the project called .gitlab-ci.yml
with the following content.
The image
property defines the Docker image to be used within the pipeline.
In this case, we’ll be using Elementary’s official Docker image.
The elementary
property defines the job and the edr
commands that will be ran.
It also uploads the edr.log
as a job artifact which can be useful for debugging purposes.
Feel free to edit the .gitlab-ci.yml
to your liking and make sure to add the required variables when doing so.
For more information about GitLab’s CI/CD capabilities.