mirror of
https://github.com/docker/compose.git
synced 2026-11-17 13:45:39 +00:00
Per the spec, any job can be triggered manually by an explicit run command, its automated triggers notwithstanding — so run now accepts scheduled jobs too. The exception is a job explicitly declared with triggers.manual: false, which run rejects: meant for scheduled jobs whose out-of-schedule execution would be harmful. compose-go is bumped to the jobs-branch commit making Manual tri-state (*bool) and allowing manual and schedule to be combined. Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
27 lines
495 B
YAML
27 lines
495 B
YAML
services:
|
|
db:
|
|
image: alpine
|
|
init: true
|
|
command: sleep infinity
|
|
jobs:
|
|
migrate:
|
|
image: alpine
|
|
command: sh -c 'echo "migration done"'
|
|
triggers:
|
|
manual: true
|
|
depends_on:
|
|
db:
|
|
condition: service_started
|
|
backup:
|
|
image: alpine
|
|
command: echo backup
|
|
triggers:
|
|
schedule:
|
|
- cron: "0 3 * * *"
|
|
rotation:
|
|
image: alpine
|
|
command: echo rotation
|
|
triggers:
|
|
manual: false
|
|
schedule:
|
|
- cron: "0 3 1 * *"
|