gitlab-runner: Upgrade to 13.5.0 & add option for extra paths to create

This patch adds a variable to the gitlab-runner, to create additional folders, that will be created with the needed SELinux permissions to be mounted inside of the container. This is used for the persistence of the hetzner-autoscale runner for example (see the README.md)
This commit is contained in:
saibotk 2020-11-05 03:08:14 +01:00
parent 57c4d33115
commit 61f7d89d56
No known key found for this signature in database
GPG key ID: A3299C587D5DF523
3 changed files with 14 additions and 2 deletions

View file

@ -24,7 +24,7 @@ Role Variables
```yaml
# This image has the hetzner plugin pre-installed
gitlabrunner_image: "quay.io/shivering-isles/gitlab-hetzner-runner"
gitlabrunner_image_version: 13.2.2
gitlabrunner_image_version: 13.5.0
# Adjust the name of the runner
gitlabrunner_name: "hetzner-docker-auto-scale"
@ -49,6 +49,13 @@ gitlabrunner_machine_options:
hetzner-server-type: "cx11" # The server type (the hardware configuration) to use for a new machine
hetzner-server-location: "fsn1" # The server location to use for a new machine
# Extra volumes that should be added to the gitlab runner container.
gitlabrunner_extra_volumes:
- "./hetzner_machine:/root/.docker/machine"
# Extra paths that should be created (eg. to be mounted in the container)
gitlabrunner_extra_paths:
- "{{ gitlabrunner_install_location }}/hetzner_machine"
```
Dependencies

View file

@ -23,7 +23,10 @@ gitlabrunner_config_location: "{{ gitlabrunner_install_location }}/config"
# The runner image & tag/version to be used
gitlabrunner_image: "docker.io/gitlab/gitlab-runner"
gitlabrunner_image_version: "alpine-v13.4.1"
gitlabrunner_image_version: "alpine-v13.5.0"
# Extra paths that should be created (eg. to be mounted in the container)
gitlabrunner_extra_paths: []
# Extra volumes that should be added to the gitlab runner container.
gitlabrunner_extra_volumes: []

View file

@ -25,6 +25,7 @@
state: present
with_items:
- "{{ gitlabrunner_config_location }}"
- "{{ gitlabrunner_extra_paths }}"
become: true
- name: Create install directory
@ -48,6 +49,7 @@
setype: "container_file_t"
with_items:
- "{{ gitlabrunner_config_location }}"
- "{{ gitlabrunner_extra_paths }}"
become: true
- name: Deploy docker-compose.yml