Files
umami/.woodpecker/deploy.yaml
T
mifi d6fa71f607
ci/woodpecker/push/ci Pipeline failed
ci/woodpecker/push/deploy Pipeline was skipped
refactor(umami): migrate PostgreSQL to portable block storage
2026-12-02 20:34:58 -03:00

88 lines
3.2 KiB
YAML

# Deploy: trigger Portainer stack redeploy (stack-from-repo; no image build).
# Runs on push/tag/manual to main only, after ci workflow succeeds.
skip_clone: true
workspace:
base: /tmp
path: deploy
when:
- branch: main
event: [push, tag, manual]
- event: deployment
evaluate: 'CI_PIPELINE_DEPLOY_TARGET == "production"'
depends_on:
- ci
steps:
- name: Trigger Dockhand Deploy
image: alpine:3.22
environment:
DOCKHAND_WEBHOOK_URL:
from_secret: dockhand_webhook_url
DOCKHAND_WEBHOOK_SECRET:
from_secret: dockhand_webhook_secret
commands:
- apk add --no-cache curl openssl
- export PAYLOAD='{}'
- export SIGNATURE="sha256=$(printf %s "$PAYLOAD" | openssl dgst -sha256 -hmac "$DOCKHAND_WEBHOOK_SECRET" -hex | sed 's/^.* //')"
- set -e
- echo "=== Triggering Dockhand deploy ==="
- >-
curl --fail --show-error --silent --request POST "$DOCKHAND_WEBHOOK_URL"
--header 'Content-Type: application/json' --header "X-Hub-Signature-256: $SIGNATURE"
--data "$PAYLOAD"
# image: curlimages/curl:latest
# environment:
# WEBHOOK_SECRET:
# from_secret: dockhand_webhook_secret
# WEBHOOK_URL:
# from_secret: dockhand_webhook_url
# commands:
# - set -e
# - echo "=== Triggering Dockhand deploy ==="
# - |
# resp=$(curl -s -w "\n%{http_code}" -X POST "$WEBHOOK_URL")
# body=$(echo "$resp" | head -n -1)
# code=$(echo "$resp" | tail -n 1)
# if [ "$code" != "200" ] && [ "$code" != "204" ]; then
# echo "Webhook failed (HTTP $code): $body"
# exit 1
# fi
# echo "✓ Dockhand deploy triggered (HTTP $code)"
- name: Send Deploy Status Notification (success)
image: curlimages/curl
environment:
MATTERMOST_BOT_ACCESS_TOKEN:
from_secret: mattermost_bot_access_token
MATTERMOST_CHANNEL_ID:
from_secret: mattermost_pushes_channel_id
MATTERMOST_POST_API_URL:
from_secret: mattermost_post_api_url
commands:
- |
BODY=$(printf '{"channel_id":"%s","message":"[%s - Build #%s] Production Deploy success 🎉"}' "$MATTERMOST_CHANNEL_ID" "$CI_REPO" "$CI_PIPELINE_NUMBER")
curl -sS -X POST -H "Content-Type: application/json" -d "$BODY" -H "Authorization: Bearer $MATTERMOST_BOT_ACCESS_TOKEN" "$MATTERMOST_POST_API_URL"
depends_on:
- Trigger Dockhand Deploy
when:
- status: [success]
- name: Send Deploy Status Notification (failure)
image: curlimages/curl
environment:
MATTERMOST_BOT_ACCESS_TOKEN:
from_secret: mattermost_bot_access_token
MATTERMOST_CHANNEL_ID:
from_secret: mattermost_pushes_channel_id
MATTERMOST_POST_API_URL:
from_secret: mattermost_post_api_url
commands:
- |
BODY=$(printf '{"channel_id":"%s","message":"[%s - Build #%s] Production Deploy failure 💩"}' "$MATTERMOST_CHANNEL_ID" "$CI_REPO" "$CI_PIPELINE_NUMBER")
curl -sS -X POST -H "Content-Type: application/json" -d "$BODY" -H "Authorization: Bearer $MATTERMOST_BOT_ACCESS_TOKEN" "$MATTERMOST_POST_API_URL"
depends_on:
- Trigger Dockhand Deploy
when:
- status: [failure]