infrastructure/roles/gitlab-runner/templates/config.toml
saibotk 2d42840203
gitlab-runner: Refactor role to allow deploying various executors
This patch adjusts the role to allow for deployments of the docker, docker+machine and shell executors. 
The default is now the docker executor instead of the docker+machine executor. Also all defaults have been adjusted for this use case.
2020-08-13 06:17:11 +02:00

61 lines
2.2 KiB
TOML

# 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 = {{ gitlabrunner_concurrent }}
check_interval = {{ gitlabrunner_check_interval }}
[[runners]]
name = "{{ gitlabrunner_name }}"
limit = {{ gitlabrunner_limit }}
url = "{{ gitlabrunner_gitlab_url }}"
token = "{{ gitlabrunner_gitlab_token }}"
executor = "{{ gitlabrunner_executor }}"
{% if gitlabrunner_executor == "docker" or gitlabrunner_executor == "docker+machine" %}
[runners.docker]
image = "{{ gitlabrunner_docker_image }}"
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" %}
[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 }}"
MachineOptions = [
{% for key, value in gitlabrunner_machine_options.items() %}
"{{ key }}={{ value }}",
{% endfor %}
]
{% endif %}
[runners.cache]
{% if gitlabrunner_cache_s3.enabled %}
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 }}"
Insecure = false
{% endif %}