Skip to main content

Setup in a self-managed instance

Prerequisites

  • A self-managed GitLab instance with an up-to-date version.
  • GitLab Runners for your Instance, Group or Project

Optional: Setup GitLab Runners

  • Install GitLab Runner Operator
  • Create a GitLab Runners for your Instance, Group or Project
  • Configure the variable XDG_CACHE_HOME to point to a shared volume that is RWX. You skip this option to avoid cache poisoning.
  • Configure the variable XDG_DATA_HOME to point to a extra volume that is RWO.

Environment Variables for the GitLab Runner

NameDefault valueRequiredEncodingDescriptionJobs related
XDG_CACHE_HOMEunsetnostringEnables caching, Points to a shared volume for Projects and JobsAll pipelines
XDG_DATA_HOMEunsetnostringEnables extra storage, Points to a local volume to circumvent ephemeral storage shortageAll pipelines

Setup CI Tools in a self-managed instance

  • Create a group xrow-public in your self-managed instance.
  • Create a project ci-tools in your self-managed instance.
  • Remove the protected branch
  • Setup a repository mirror from https://gitlab.com/xrow-public/ci-tools.git with direction pull
  • Create a own components group for your company e.g. components
  • Create a project mycompany in components
  • Create a new component called common by creating the file templates/common/template.yml. Please notice the configuration for the disconnected setup with a external registry.

templates/common/template.yml

spec:
inputs:
registry:
default: "registry.mycompany.com"
repository-path:
default: "${CI_PROJECT_PATH}"
proxy:
default: false
type: boolean
---

include:
- component: $CI_SERVER_FQDN/xrow-public/ci-tools/common@stable
inputs:
repo: $[[ inputs.registry ]]/proxy-gitlab/xrow-public/ci-tools
registry: $[[ inputs.registry ]]
repository-path: $[[ inputs.repository-path ]]
stages:
- prepare
- lint
- build
- test
- render
- validate
- deploy

variables:
CI_REGISTRY_IMAGE: "$[[ inputs.registry | expand_vars ]]/$[[ inputs.repository-path | expand_vars ]]"
CI_TEMPLATE_REGISTRY_HOST: $[[ inputs.registry ]]/proxy-gitlab

Now you can use your component instead components/mycompany/common of xrow-public/ci-tools/common.

Service Account Access Token and Setup