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_HOMEto point to a shared volume that is RWX. You skip this option to avoid cache poisoning. - Configure the variable
XDG_DATA_HOMEto point to a extra volume that is RWO.
Environment Variables for the GitLab Runner
| Name | Default value | Required | Encoding | Description | Jobs related |
|---|---|---|---|---|---|
XDG_CACHE_HOME | unset | no | string | Enables caching, Points to a shared volume for Projects and Jobs | All pipelines |
XDG_DATA_HOME | unset | no | string | Enables extra storage, Points to a local volume to circumvent ephemeral storage shortage | All pipelines |
Setup CI Tools in a self-managed instance
- Create a group
xrow-publicin your self-managed instance. - Create a project
ci-toolsin your self-managed instance. - Remove the protected branch
- Setup a repository mirror from
https://gitlab.com/xrow-public/ci-tools.gitwith direction pull - Create a own components group for your company e.g.
components - Create a project
mycompanyincomponents - Create a new component called
commonby 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.