From ff0d43f1d399f10d47b6b6d9cd75d5be398b1cd9 Mon Sep 17 00:00:00 2001 From: 6543 <6543@obermui.de> Date: Thu, 12 Feb 2026 12:09:57 +0100 Subject: [PATCH] document how to ignore failure on services (#6106) Co-authored-by: Robert Kaussow --- .woodpecker/securityscan.yaml | 1 + docs/docs/20-usage/60-services.md | 14 ++++++++++++++ .../linter/schema/.woodpecker/test-service.yaml | 1 + pipeline/frontend/yaml/linter/schema/schema.json | 6 ++++++ 4 files changed, 22 insertions(+) diff --git a/.woodpecker/securityscan.yaml b/.woodpecker/securityscan.yaml index 7382a027b..ee396b62c 100644 --- a/.woodpecker/securityscan.yaml +++ b/.woodpecker/securityscan.yaml @@ -34,6 +34,7 @@ steps: services: server: image: *trivy_plugin + failure: ignore # as we don't care about the exit code settings: service: true db-repository: mirror.gcr.io/aquasec/trivy-db:2 diff --git a/docs/docs/20-usage/60-services.md b/docs/docs/20-usage/60-services.md index 3697fef48..fa243f70f 100644 --- a/docs/docs/20-usage/60-services.md +++ b/docs/docs/20-usage/60-services.md @@ -37,6 +37,20 @@ services: - 51820/udp ``` +## Stopping + +Services that are no longer needed receive a **SIGTERM** signal. If they do not respond, they are forcibly terminated with **SIGKILL**. +If there are services that do not shut down properly and this doesn't matter, you can simply ignore the error: + +```diff + services: + - name: database + image: mysql ++ failure: ignore # we don't care how mysql exits + ports: + - 3306 +``` + ## Configuration Service containers generally expose environment variables to customize service startup such as default usernames, passwords and ports. Please see the official image documentation to learn more. diff --git a/pipeline/frontend/yaml/linter/schema/.woodpecker/test-service.yaml b/pipeline/frontend/yaml/linter/schema/.woodpecker/test-service.yaml index 70725ff11..bc4c350a7 100644 --- a/pipeline/frontend/yaml/linter/schema/.woodpecker/test-service.yaml +++ b/pipeline/frontend/yaml/linter/schema/.woodpecker/test-service.yaml @@ -16,6 +16,7 @@ services: cache: image: redis + failure: ignore directory: /tmp/ ports: - '6379' diff --git a/pipeline/frontend/yaml/linter/schema/schema.json b/pipeline/frontend/yaml/linter/schema/schema.json index 51e1bed7c..5b20b1ee0 100644 --- a/pipeline/frontend/yaml/linter/schema/schema.json +++ b/pipeline/frontend/yaml/linter/schema/schema.json @@ -879,6 +879,12 @@ "volumes": { "$ref": "#/definitions/step_volumes" }, + "failure": { + "description": "How to handle the failure of this step. Read more: https://woodpecker-ci.org/docs/usage/services#stopping", + "type": "string", + "enum": ["fail", "ignore"], + "default": "fail" + }, "backend_options": { "$ref": "#/definitions/step_backend_options" },