Make sure the messaging doesn't fire too early
Some checks failed
ci/woodpecker/push/build Pipeline was successful
ci/woodpecker/deployment/production Pipeline failed

This commit is contained in:
2026-02-01 23:08:51 -03:00
parent 4da965ffe9
commit 7a557a3f07

View File

@@ -22,6 +22,20 @@ steps:
--label "git.branch=${CI_COMMIT_BRANCH}" \ --label "git.branch=${CI_COMMIT_BRANCH}" \
. .
- name: Send Build Status Notification (failure)
image: curlimages/curl
environment:
DISCORD_WEBHOOK_URL:
from_secret: discord_webhook_url
commands:
- |
BODY=$(printf '{"username":"WoodpeckerBot","content":"[%s - Build #%s] Build failure 💩"}' "$CI_REPO" "$CI_PIPELINE_NUMBER")
curl -sS -X POST -H "Content-Type: application/json" -d "$BODY" "$DISCORD_WEBHOOK_URL"
depends_on:
- Docker image build
when:
- status: [ failure ]
- name: Push to registry - name: Push to registry
image: docker:latest image: docker:latest
environment: environment:
@@ -52,6 +66,8 @@ steps:
- | - |
BODY=$(printf '{"username":"WoodpeckerBot","content":"[%s - Build #%s] Publish success 🎉"}' "$CI_REPO" "$CI_PIPELINE_NUMBER") BODY=$(printf '{"username":"WoodpeckerBot","content":"[%s - Build #%s] Publish success 🎉"}' "$CI_REPO" "$CI_PIPELINE_NUMBER")
curl -sS -X POST -H "Content-Type: application/json" -d "$BODY" "$DISCORD_WEBHOOK_URL" curl -sS -X POST -H "Content-Type: application/json" -d "$BODY" "$DISCORD_WEBHOOK_URL"
depends_on:
- Push to registry
when: when:
- status: [ success ] - status: [ success ]
@@ -64,5 +80,7 @@ steps:
- | - |
BODY=$(printf '{"username":"WoodpeckerBot","content":"[%s - Build #%s] Publish failure 💩"}' "$CI_REPO" "$CI_PIPELINE_NUMBER") BODY=$(printf '{"username":"WoodpeckerBot","content":"[%s - Build #%s] Publish failure 💩"}' "$CI_REPO" "$CI_PIPELINE_NUMBER")
curl -sS -X POST -H "Content-Type: application/json" -d "$BODY" "$DISCORD_WEBHOOK_URL" curl -sS -X POST -H "Content-Type: application/json" -d "$BODY" "$DISCORD_WEBHOOK_URL"
depends_on:
- Push to registry
when: when:
- status: [ failure ] - status: [ failure ]