mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2026-02-13 21:00:00 +00:00
document how to ignore failure on services (#6106)
Co-authored-by: Robert Kaussow <xoxys@rknet.org>
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -16,6 +16,7 @@ services:
|
||||
|
||||
cache:
|
||||
image: redis
|
||||
failure: ignore
|
||||
directory: /tmp/
|
||||
ports:
|
||||
- '6379'
|
||||
|
||||
@@ -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"
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user