infrastructure/roles/gitlab_runner/templates/config.toml

64 lines
2.4 KiB
TOML
Raw Normal View History

2020-08-10 01:37:13 +02:00
# Infrastructure
# Ansible instructions to deploy the infrastructure
# Copyright (C) 2019-2020 Christoph (Sheogorath) Kern
# Copyright (C) 2020 Saibotk
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, version 3 of the License.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
concurrent = {{ gitlab_runner_concurrent }}
check_interval = {{ gitlab_runner_check_interval }}
2020-08-10 01:37:13 +02:00
{% for gitlabrunner in gitlab_runner_runners %}
2020-08-10 01:37:13 +02:00
[[runners]]
name = "{{ gitlabrunner.name }}"
limit = {{ gitlabrunner.limit | default(1) }}
url = "{{ gitlabrunner.gitlab_url }}"
token = "{{ gitlabrunner.gitlab_token }}"
executor = "{{ gitlabrunner.executor }}"
{% if gitlabrunner.executor == "docker" or gitlabrunner.executor == "docker+machine" %}
2020-08-10 01:37:13 +02:00
[runners.docker]
image = "{{ gitlabrunner.docker_image | default("docker.io/library/docker:stable") }}"
privileged = {{ gitlabrunner.docker_privileged | bool | lower }}
volumes = [
"/cache",
{% if gitlabrunner.docker_mount_socket %}
"/var/run/docker.sock:/var/run/docker.sock"
{% endif %}
]
{% endif %}
{% if gitlabrunner.executor == "docker+machine" %}
2020-08-10 01:37:13 +02:00
[runners.machine]
IdleCount = {{ gitlabrunner.machine_idle_count }}
IdleTime = {{ gitlabrunner.machine_idle_time }}
MaxBuilds = {{ gitlabrunner.machine_max_builds }}
MachineDriver = "{{ gitlabrunner.machine_driver }}"
MachineName = "{{ gitlabrunner.machine_name }}"
2020-08-10 01:37:13 +02:00
MachineOptions = [
{% for key, value in gitlabrunner.machine_options.items() %}
"{{ key }}={{ value }}",
{% endfor %}
2020-08-10 01:37:13 +02:00
]
{% endif %}
2020-08-10 01:37:13 +02:00
[runners.cache]
{% if gitlabrunner.cache_s3 is defined %}
2020-08-10 01:37:13 +02:00
Type = "s3"
Shared = false
[runners.cache.s3]
ServerAddress = "{{ gitlabrunner.cache_s3.server }}"
AccessKey = "{{ gitlabrunner.cache_s3.access_key }}"
SecretKey = "{{ gitlabrunner.cache_s3.secret_key }}"
BucketName = "{{ gitlabrunner.cache_s3.bucket }}"
2020-08-10 01:37:13 +02:00
Insecure = false
{% endif %}
{% endfor %}