Add update_config/rollback_config start-first rolling deploy; fix depends_on indent bug

This commit is contained in:
2026-07-16 21:44:47 -07:00
parent beb53ce9ff
commit 26177f5706
+26 -30
View File
@@ -1,37 +1,22 @@
version: '3.8'
services: services:
# Woodpecker Server - Central orchestration
woodpecker-server: woodpecker-server:
image: woodpeckerci/woodpecker-server:latest image: woodpeckerci/woodpecker-server:latest
ports: ports:
- "8000:8000" # HTTP - "8000:8000"
- "9000:9000" # gRPC (agents communicate here) - "9000:9000"
environment: environment:
# Server configuration
WOODPECKER_HOST: https://${WOODPECKER_HOST} WOODPECKER_HOST: https://${WOODPECKER_HOST}
WOODPECKER_PROTO: https WOODPECKER_PROTO: https
WOODPECKER_OPEN: "false" # Private instance WOODPECKER_OPEN: "false"
# Gitea integration
WOODPECKER_GITEA: "true" WOODPECKER_GITEA: "true"
WOODPECKER_GITEA_URL: https://${GITEA_HOST} WOODPECKER_GITEA_URL: https://${GITEA_HOST}
WOODPECKER_GITEA_CLIENT: ${WOODPECKER_GITEA_CLIENT} WOODPECKER_GITEA_CLIENT: ${WOODPECKER_GITEA_CLIENT}
WOODPECKER_GITEA_SECRET: ${WOODPECKER_GITEA_SECRET} WOODPECKER_GITEA_SECRET: ${WOODPECKER_GITEA_SECRET}
# Agent security
WOODPECKER_AGENT_SECRET: ${WOODPECKER_AGENT_SECRET} WOODPECKER_AGENT_SECRET: ${WOODPECKER_AGENT_SECRET}
# Allow organizations
WOODPECKER_ORGS: homelab,admin WOODPECKER_ORGS: homelab,admin
# Logging
WOODPECKER_LOG_LEVEL: info WOODPECKER_LOG_LEVEL: info
# Database (using existing PostgreSQL)
WOODPECKER_DATABASE_DRIVER: postgres WOODPECKER_DATABASE_DRIVER: postgres
WOODPECKER_DATABASE_DATASOURCE: postgres://${DB_USER}:${DB_PASS}@${POSTGRES_HOST}:${POSTGRES_PORT}/woodpecker?sslmode=disable WOODPECKER_DATABASE_DATASOURCE: postgres://${DB_USER}:${DB_PASS}@${POSTGRES_HOST}:${POSTGRES_PORT}/woodpecker?sslmode=disable
volumes: volumes:
- /var/run/docker.sock:/var/run/docker.sock - /var/run/docker.sock:/var/run/docker.sock
- /etc/timezone:/etc/timezone:ro - /etc/timezone:/etc/timezone:ro
@@ -43,7 +28,7 @@ services:
replicas: 1 replicas: 1
placement: placement:
constraints: constraints:
- node.hostname == docker-2 # Run on manager node only - node.hostname == docker-2
labels: labels:
- traefik.enable=true - traefik.enable=true
- traefik.http.routers.woodpecker.entrypoints=websecure - traefik.http.routers.woodpecker.entrypoints=websecure
@@ -52,23 +37,26 @@ services:
- traefik.http.routers.woodpecker.tls.certresolver=letsencrypt - traefik.http.routers.woodpecker.tls.certresolver=letsencrypt
- traefik.docker.network=traefik_backend - traefik.docker.network=traefik_backend
- traefik.http.services.woodpecker.loadbalancer.server.port=8000 - traefik.http.services.woodpecker.loadbalancer.server.port=8000
update_config:
parallelism: 1
delay: 15s
failure_action: rollback
monitor: 30s
order: start-first
rollback_config:
parallelism: 1
failure_action: pause
order: start-first
# Woodpecker Agents - Pipeline execution
woodpecker-agent: woodpecker-agent:
image: woodpeckerci/woodpecker-agent:latest image: woodpeckerci/woodpecker-agent:latest
command: agent command: agent
environment: environment:
# Server connection
WOODPECKER_SERVER: woodpecker-server:9000 WOODPECKER_SERVER: woodpecker-server:9000
WOODPECKER_AGENT_SECRET: ${WOODPECKER_AGENT_SECRET} WOODPECKER_AGENT_SECRET: ${WOODPECKER_AGENT_SECRET}
WOODPECKER_MAX_PROCS: 4
# Agent configuration
WOODPECKER_MAX_PROCS: 4 # Max parallel builds per agent
WOODPECKER_LOG_LEVEL: info WOODPECKER_LOG_LEVEL: info
# Labels for scheduling
WOODPECKER_FILTER_LABELS: "true" WOODPECKER_FILTER_LABELS: "true"
volumes: volumes:
- /var/run/docker.sock:/var/run/docker.sock - /var/run/docker.sock:/var/run/docker.sock
- /etc/timezone:/etc/timezone:ro - /etc/timezone:/etc/timezone:ro
@@ -76,9 +64,17 @@ services:
networks: networks:
- traefik_backend - traefik_backend
deploy: deploy:
mode: global # One agent per node mode: global
depends_on: update_config:
- woodpecker-server parallelism: 1
delay: 30s
failure_action: rollback
monitor: 15s
order: start-first
rollback_config:
parallelism: 1
failure_action: pause
order: start-first
networks: networks:
traefik_backend: traefik_backend: