diff --git a/.env.example b/.env.example index fd1e3ab..53e6df2 100644 --- a/.env.example +++ b/.env.example @@ -5,4 +5,10 @@ TOKEN=your_token_here NODE_ENV=dev # database -DATABASE_URL=file:./db.sqlite \ No newline at end of file +DATABASE_URL=file:./db.sqlite + +# deploy discord webhook token +DEPLOY_WEBHOOK_TOKEN=your_token_here + +# deploy discord webhook id +DEPLOY_WEBHOOK_ID=your_id_here \ No newline at end of file diff --git a/compose.yml b/compose.yml index 2e0b5c7..1e44df6 100644 --- a/compose.yml +++ b/compose.yml @@ -8,13 +8,38 @@ services: required: false volumes: - eery-data:/data + labels: + - "com.centurylinklabs.watchtower.enable=true" watchtower: image: containrrr/watchtower restart: always + container_name: eery-watchtower + environment: + WATCHTOWER_NOTIFICATIONS: discord://${DEPLOY_WEBHOOK_TOKEN}@${DEPLOY_WEBHOOK_ID} + WATCHTOWER_NOTIFICATION_TEMPLATE: | + {{- if .Report -}} + {{- with .Report -}} + {{len .Scanned}} Scanned, {{len .Updated}} Updated, {{len .Failed}} Failed + {{- range .Updated}} + - {{.Name}} ({{.ImageName}}): {{.CurrentImageID.ShortID}} updated to {{.LatestImageID.ShortID}} + {{- end -}} + {{- range .Fresh}} + - {{.Name}} ({{.ImageName}}): {{.State}} + {{- end -}} + {{- range .Skipped}} + - {{.Name}} ({{.ImageName}}): {{.State}}: {{.Error}} + {{- end -}} + {{- range .Failed}} + - {{.Name}} ({{.ImageName}}): {{.State}}: {{.Error}} + {{- end -}} + {{- end -}} + {{- else -}} + {{range .Entries -}}{{.Message}}{{"\n"}}{{- end -}} + {{- end -}} volumes: - /var/run/docker.sock:/var/run/docker.sock - command: --interval 300 --cleanup --label-enable --run-once eery-bot + command: --interval 60 --cleanup --label-enable volumes: eery-data: