Valqore DocsDocs
IntegrationsGitLab CI

GitLab CI

Integrate Valqore into GitLab CI/CD pipelines.

GitLab CI

Valqore provides a reusable CI template that adds a valqore stage to evaluate manifests and post results as a merge-request comment.

Quick Start

include:
  - remote: "https://raw.githubusercontent.com/valqore/ci-templates/main/gitlab-ci-valqore.yml"

Full Configuration

# .gitlab-ci.yml
include:
  - remote: "https://raw.githubusercontent.com/valqore/ci-templates/main/gitlab-ci-valqore.yml"
 
stages:
  - build
  - test
  - valqore
  - deploy
 
valqore_analysis:
  stage: valqore
  variables:
    VALQORE_MANIFESTS: "k8s/"
    VALQORE_FAIL_ON: "block"
    VALQORE_CARBON_REGION: "eu-west-1"
  rules:
    - if: $CI_PIPELINE_SOURCE == "merge_request_event"
      changes:
        - k8s/**/*
        - manifests/**/*
        - helm/**/*
        - terraform/**/*

MR Comment

To enable merge request comments, add a project or group access token with the api scope:

valqore_analysis:
  stage: valqore
  variables:
    VALQORE_MANIFESTS: "k8s/"
    VALQORE_FAIL_ON: "block"
    VALQORE_GITLAB_TOKEN: $GITLAB_API_TOKEN

Variables Reference

VariableRequiredDefaultDescription
VALQORE_MANIFESTSYes--Path or glob to manifests.
VALQORE_FAIL_ONNoblockVerdict level that fails the job.
VALQORE_CARBON_REGIONNous-east-1Cloud region for carbon calculations.
VALQORE_GITLAB_TOKENNo--GitLab API token for MR comments.
VALQORE_API_KEYYes--Valqore API key (store as CI/CD variable).
Was this helpful?
Valqore Docs
Copyright © Cruip. All rights reserved.