From 45754ea894d9295f885c0504b8be321ab93a1b4c Mon Sep 17 00:00:00 2001 From: Bertrand Lanson Date: Sat, 12 Aug 2023 19:34:17 +0200 Subject: [PATCH] few mods to make the docker deployment method work --- defaults/main.yml | 2 +- molecule/with_docker_host/group_vars/all.yml | 14 +++++++------- templates/docker-compose.yml.j2 | 4 ++-- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/defaults/main.yml b/defaults/main.yml index 26aa9eb..dbc4beb 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -24,7 +24,7 @@ deploy_gitea_runner_config: enabled: true dir: "{{ deploy_gitea_runner_directory }}/cache" # this HAS TO BE /cache if deploy_gitea_runner_deploy_method is docker host: 127.0.0.1 - port: 9898 + port: 4974 external_server: container: network: "" diff --git a/molecule/with_docker_host/group_vars/all.yml b/molecule/with_docker_host/group_vars/all.yml index 2c607f8..d99c38e 100644 --- a/molecule/with_docker_host/group_vars/all.yml +++ b/molecule/with_docker_host/group_vars/all.yml @@ -1,10 +1,10 @@ --- deploy_gitea_runner_version: latest -deploy_gitea_runner_deploy_method: host # deployment method, either host or docker. +deploy_gitea_runner_deploy_method: docker # deployment method, either host or docker. deploy_gitea_runner_directory: /opt/gitea-actions deploy_gitea_runner_timezone: "Europe/Paris" deploy_gitea_runner_register: true -deploy_gitea_runner_start_service: true +deploy_gitea_runner_start_service: false deploy_gitea_runner_server_url: https://git.ednz.fr deploy_gitea_runner_server_token: "secret-token" deploy_gitea_runner_name: gitea-runner @@ -12,16 +12,16 @@ deploy_gitea_runner_config: log: level: info runner: - file: "{{ deploy_gitea_runner_directory }}/.runner" # this HAS TO BE .runner if deploy_gitea_runner_deploy_method is docker + file: ".runner" # this HAS TO BE .runner if deploy_gitea_runner_deploy_method is docker capacity: 1 timeout: 3h insecure: false fetch_timeout: 5s fetch_interval: 2s - labels: ["ubuntu-latest:host"] + labels: ["ubuntu-latest:docker://node:16-bullseye"] cache: - enabled: true - dir: "{{ deploy_gitea_runner_directory }}/cache" # this HAS TO BE /cache if deploy_gitea_runner_deploy_method is docker + enabled: false + dir: "/cache" # this HAS TO BE /cache if deploy_gitea_runner_deploy_method is docker host: 127.0.0.1 port: 9898 external_server: @@ -31,6 +31,6 @@ deploy_gitea_runner_config: options: "" workdir_parent: valid_volumes: [] - docker_host: "-" + docker_host: "" host: workdir_parent: diff --git a/templates/docker-compose.yml.j2 b/templates/docker-compose.yml.j2 index 6303141..a0ccf34 100644 --- a/templates/docker-compose.yml.j2 +++ b/templates/docker-compose.yml.j2 @@ -16,7 +16,7 @@ services: - data:/data {% if deploy_gitea_runner_config['cache']['enabled'] is defined and deploy_gitea_runner_config['cache']['enabled'] %} - cache:/cache -{%- endif %} +{% endif %} - /var/run/docker.sock:/var/run/docker.sock {% if deploy_gitea_runner_config['cache']['port'] is defined %} ports: @@ -24,7 +24,7 @@ services: published: {{ deploy_gitea_runner_config['cache']['port'] }} protocol: tcp mode: ingress -{%- endif %} +{% endif %} networks: - internal