67 lines
3.5 KiB
YAML
67 lines
3.5 KiB
YAML
version: '2'
|
|
|
|
services:
|
|
gitlab-runner-config:
|
|
image: gitlab/gitlab-runner:alpine # Alpine Linux image is designed to use only Docker as the method of spawning runners
|
|
command:
|
|
- register
|
|
environment: # Options can be found by running "gitlab-runner register". More info found at https://docs.gitlab.com/runner/configuration/advanced-configuration.html
|
|
REGISTER_NON_INTERACTIVE: true # Run registration unattended
|
|
CI_SERVER_URL: http://${GITLAB_HOST}/ # GitLab Server URL
|
|
REGISTRATION_TOKEN: ${GITLAB_TOKEN} # Runner's registration token
|
|
RUNNER_EXECUTOR: docker # Select executor, eg. shell, docker, etc.
|
|
{{- if .Values.GITLAB_RUNNER_DESCRIPTION}}
|
|
RUNNER_NAME: ${GITLAB_RUNNER_DESCRIPTION} # Runner name
|
|
{{- end}}
|
|
{{- if .Values.GITLAB_TAGS}}
|
|
RUNNER_TAG_LIST: ${GITLAB_TAGS} # Tag list
|
|
{{- end}}
|
|
REGISTER_LOCKED: false # Lock Runner for current project
|
|
DOCKER_IMAGE: docker:latest # Docker image to be used
|
|
DOCKER_VOLUMES: "/var/run/docker.sock:/var/run/docker.sock" # Docker Socket binding
|
|
labels:
|
|
io.rancher.container.pull_image: always
|
|
io.rancher.container.start_once: true
|
|
{{- if .Values.HOST_LABEL}}
|
|
io.rancher.scheduler.affinity:host_label: ${HOST_LABEL}
|
|
{{- end}}
|
|
traefik.enable: false
|
|
volumes:
|
|
- GitLab-Runner:/etc/gitlab-runner
|
|
gitlab-runner:
|
|
image: gitlab/gitlab-runner:alpine # Alpine Linux image is designed to use only Docker as the method of spawning runners
|
|
command:
|
|
- run
|
|
environment: # Options can be found by running "gitlab-runner register". More info found at https://docs.gitlab.com/runner/configuration/advanced-configuration.html
|
|
REGISTER_NON_INTERACTIVE: true # Run registration unattended
|
|
CI_SERVER_URL: ${GITLAB_URL} # GitLab Server URL
|
|
REGISTRATION_TOKEN: ${GITLAB_TOKEN} # Runner's registration token
|
|
RUNNER_EXECUTOR: docker # Select executor, eg. shell, docker, etc.
|
|
{{- if .Values.GITLAB_RUNNER_DESCRIPTION}}
|
|
RUNNER_NAME: ${GITLAB_RUNNER_DESCRIPTION} # Runner name
|
|
{{- end}}
|
|
{{- if .Values.GITLAB_TAGS}}
|
|
RUNNER_TAG_LIST: ${GITLAB_TAGS} # Tag list
|
|
{{- end}}
|
|
REGISTER_LOCKED: false # Lock Runner for current project
|
|
DOCKER_IMAGE: docker:latest # Docker image to be used
|
|
DOCKER_VOLUMES: "/var/run/docker.sock:/var/run/docker.sock" # Docker Socket binding
|
|
labels:
|
|
io.rancher.container.pull_image: always
|
|
{{- if .Values.HOST_LABEL}}
|
|
io.rancher.scheduler.affinity:host_label: ${HOST_LABEL}
|
|
{{- end}}
|
|
io.rancher.sidekicks: gitlab-runner-config
|
|
traefik.enable: false
|
|
privileged: true
|
|
restart: always
|
|
volumes:
|
|
- /etc/localtime:/etc/localtime:ro # Syncronize time of container with the host system
|
|
- /etc/timezone:/etc/timezone:ro # Syncronize timezone of container with the host system
|
|
- /var/run/docker.sock:/var/run/docker.sock
|
|
- GitLab-Runner:/etc/gitlab-runner
|
|
|
|
volumes:
|
|
GitLab-Runner:
|
|
driver: local
|