CI_pipeline

CI Pipeline

Access Token

You need to add the current access key, to push into our container registry. Place the Key like seen on the following picture.

  • Click on Settings
  • Click on CI/CD
  • Expand Variables
  • Click on Add Variable
  • Click Mask variable (IMPORTANT)
  • add Key: CI_MSD_CONTAINER_AUTH_TOKEN
  • add Value: IMPORTANT: The key is given by the DevOps Team and valid for one semester
  • Click on Save changes

token


Gitlab CI-FILE


Section in file

Section Description
include includes our stages to build container and
and helm chart and publish both to our registry
stages defines the stages of this ci-file, add more stages
if needed, like test, validate, build and so on
variables defines environment variables of this script (variables set outside of this file didnt need to called here)
defined
stages
runs the defined stages in the example down the basics

gitlab-ci.yaml

include:
  - project: "the-microservice-dungeon/devops-team/common-ci-cd"
    ref: "main"
    file:
      - "helm/package-publish.yaml"
      - "container/image-dockerfile-publish.yaml"

stages: # TODO add needed Stages like test, build and so on
  - build_container_push
  - helm

variables:
  PATH_TO_CHART: "helm-chart"
  # TODO Change Player-Name to your Player
  CHART_NAME: "player-changeme"
  # TODO Change Image name to Player-Name (end of line)
  CI_MSD_CONTAINER_REGISTRY: "registry.gitlab.com/the-microservice-dungeon/devops-team/msd-image-registry/changeme"



# build stage use this, to build docker image from dockerfile and push it to our container registry
container-image-publish:
  rules:
    - if: $CI_COMMIT_REF_NAME == $CI_DEFAULT_BRANCH
    - if: '$CI_PIPELINE_SOURCE == "web"'
      when: always

helm-package-publish:
  rules:
    - if: $CI_COMMIT_REF_NAME == $CI_DEFAULT_BRANCH
      changes:
        - ${PATH_TO_CHART}/**/*
    - if: '$CI_PIPELINE_SOURCE == "web"'
      when: always
Last modified May 10, 2025: modify devops cluster docs (17549c6)