From 82b6df801ff3db38477a1876ef839c14e11d20c6 Mon Sep 17 00:00:00 2001 From: Earl Warren Date: Sun, 7 Apr 2024 20:34:23 +0200 Subject: [PATCH] docker-compose example: do not use depends_on Wait for the .runner file to exist instead as a proof that the runner is ready to accept a job --- examples/docker-compose/compose-demo-workflow.yml | 3 --- examples/docker-compose/compose-forgejo-and-runner.yml | 8 ++++---- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/examples/docker-compose/compose-demo-workflow.yml b/examples/docker-compose/compose-demo-workflow.yml index 5c327e2..6b1d561 100644 --- a/examples/docker-compose/compose-demo-workflow.yml +++ b/examples/docker-compose/compose-demo-workflow.yml @@ -7,9 +7,6 @@ services: image: alpine:3.19 links: - forgejo - depends_on: - runner-register: - condition: service_completed_successfully command: >- sh -ec ' apk add --quiet git curl jq ; diff --git a/examples/docker-compose/compose-forgejo-and-runner.yml b/examples/docker-compose/compose-forgejo-and-runner.yml index 0ea195d..600825e 100644 --- a/examples/docker-compose/compose-forgejo-and-runner.yml +++ b/examples/docker-compose/compose-forgejo-and-runner.yml @@ -84,10 +84,10 @@ services: DOCKER_HOST: tcp://docker:2376 DOCKER_CERT_PATH: /certs/client DOCKER_TLS_VERIFY: "1" - depends_on: - runner-register: - condition: service_completed_successfully volumes: - /srv/runner-data:/data - docker_certs:/certs - command: "forgejo-runner --config config.yml daemon" + command: >- + bash -c ' + while : ; do test -w .runner && forgejo-runner --config config.yml daemon ; sleep 1 ; done + '