Pipeline Notification Updates (swap Discord to Mattermost)

This commit is contained in:
2026-02-11 23:40:39 -03:00
parent c094cc29ea
commit f73b7822a5
2 changed files with 93 additions and 19 deletions

View File

@@ -22,18 +22,60 @@ steps:
- pnpm run lint
- pnpm run lint:css
- name: Send Lint Status Notification (failure)
image: curlimages/curl
environment:
MATTERMOST_WEBHOOK_URL:
from_secret: mattermost_test_webhook
commands:
- |
BODY=$(printf '{"username":"WoodpeckerBot","content":"[%s - Build #%s] Lint failure 💩"}' "$CI_REPO" "$CI_PIPELINE_NUMBER")
curl -sS -X POST -H "Content-Type: application/json" -d "$BODY" "$MATTERMOST_WEBHOOK_URL"
depends_on:
- lint
when:
- status: [failure]
- name: build
image: node:20-alpine
commands:
- corepack enable && corepack prepare pnpm@10.28.2 --activate
- pnpm run build
- name: test
- name: Send Test Build Status Notification (failure)
image: curlimages/curl
environment:
MATTERMOST_WEBHOOK_URL:
from_secret: mattermost_test_webhook
commands:
- |
BODY=$(printf '{"username":"WoodpeckerBot","content":"[%s - Build #%s] Test build failure 💩"}' "$CI_REPO" "$CI_PIPELINE_NUMBER")
curl -sS -X POST -H "Content-Type: application/json" -d "$BODY" "$MATTERMOST_WEBHOOK_URL"
depends_on:
- build
when:
- status: [failure]
- name: unit test
image: node:20-alpine
commands:
- corepack enable && corepack prepare pnpm@10.28.2 --activate
- pnpm test
- name: Send Unit Test Status Notification (failure)
image: curlimages/curl
environment:
MATTERMOST_WEBHOOK_URL:
from_secret: mattermost_test_webhook
commands:
- |
BODY=$(printf '{"username":"WoodpeckerBot","content":"[%s - Build #%s] Unit test failure 💩"}' "$CI_REPO" "$CI_PIPELINE_NUMBER")
curl -sS -X POST -H "Content-Type: application/json" -d "$BODY" "$MATTERMOST_WEBHOOK_URL"
depends_on:
- unit test
when:
- status: [failure]
- name: test e2e
image: mcr.microsoft.com/playwright:v1.58.0-noble
commands:
@@ -43,3 +85,35 @@ steps:
- npx serve dist -p 4173 &
- sleep 2
- CI=1 pnpm run test:e2e
- name: Send E2E Test Status Notification (failure)
image: curlimages/curl
environment:
MATTERMOST_WEBHOOK_URL:
from_secret: mattermost_test_webhook
commands:
- |
BODY=$(printf '{"username":"WoodpeckerBot","content":"[%s - Build #%s] E2E test failure 💩"}' "$CI_REPO" "$CI_PIPELINE_NUMBER")
curl -sS -X POST -H "Content-Type: application/json" -d "$BODY" "$MATTERMOST_WEBHOOK_URL"
depends_on:
- e2e test
when:
- status: [failure]
- name: Send CI Pipeline Status Notification (success)
image: curlimages/curl
environment:
MATTERMOST_WEBHOOK_URL:
from_secret: mattermost_test_webhook
commands:
- |
BODY=$(printf '{"username":"WoodpeckerBot","content":"[%s - Build #%s] CI pipeline success 🎉"}' "$CI_REPO" "$CI_PIPELINE_NUMBER")
curl -sS -X POST -H "Content-Type: application/json" -d "$BODY" "$MATTERMOST_WEBHOOK_URL"
depends_on:
- 'install'
- 'lint'
- 'build'
- 'unit test'
- 'e2e test'
when:
- status: [success]

View File

@@ -35,12 +35,12 @@ steps:
- name: Send Build Status Notification (success)
image: curlimages/curl
environment:
DISCORD_WEBHOOK_URL:
from_secret: discord_webhook_url
MATTERMOST_WEBHOOK_URL:
from_secret: mattermost_deploy_webhook
commands:
- |
BODY=$(printf '{"username":"WoodpeckerBot","content":"[%s - Build #%s] Build 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" "$MATTERMOST_WEBHOOK_URL"
depends_on:
- 'Docker image build'
when:
@@ -49,12 +49,12 @@ steps:
- name: Send Build Status Notification (failure)
image: curlimages/curl
environment:
DISCORD_WEBHOOK_URL:
from_secret: discord_webhook_url
MATTERMOST_WEBHOOK_URL:
from_secret: mattermost_deploy_webhook
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"
curl -sS -X POST -H "Content-Type: application/json" -d "$BODY" "$MATTERMOST_WEBHOOK_URL"
depends_on:
- Docker image build
when:
@@ -90,12 +90,12 @@ steps:
- name: Send Push Status Notification (success)
image: curlimages/curl
environment:
DISCORD_WEBHOOK_URL:
from_secret: discord_webhook_url
MATTERMOST_WEBHOOK_URL:
from_secret: mattermost_deploy_webhook
commands:
- |
BODY=$(printf '{"username":"WoodpeckerBot","content":"[%s - Build #%s] Push to registry 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" "$MATTERMOST_WEBHOOK_URL"
depends_on:
- 'Push to registry'
when:
@@ -104,12 +104,12 @@ steps:
- name: Send Push Status Notification (failure)
image: curlimages/curl
environment:
DISCORD_WEBHOOK_URL:
from_secret: discord_webhook_url
MATTERMOST_WEBHOOK_URL:
from_secret: mattermost_deploy_webhook
commands:
- |
BODY=$(printf '{"username":"WoodpeckerBot","content":"[%s - Build #%s] Push to registry 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" "$MATTERMOST_WEBHOOK_URL"
depends_on:
- 'Push to registry'
when:
@@ -138,12 +138,12 @@ steps:
- name: Send Deploy Status Notification (success)
image: curlimages/curl
environment:
DISCORD_WEBHOOK_URL:
from_secret: discord_webhook_url
MATTERMOST_WEBHOOK_URL:
from_secret: mattermost_deploy_webhook
commands:
- |
BODY=$(printf '{"username":"WoodpeckerBot","content":"[%s - Build #%s] Production Deploy 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" "$MATTERMOST_WEBHOOK_URL"
depends_on:
- 'Trigger Portainer stack redeploy'
when:
@@ -152,12 +152,12 @@ steps:
- name: Send Deploy Status Notification (failure)
image: curlimages/curl
environment:
DISCORD_WEBHOOK_URL:
from_secret: discord_webhook_url
MATTERMOST_WEBHOOK_URL:
from_secret: mattermost_deploy_webhook
commands:
- |
BODY=$(printf '{"username":"WoodpeckerBot","content":"[%s - Build #%s] Production Deploy 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" "$MATTERMOST_WEBHOOK_URL"
depends_on:
- Trigger Portainer stack redeploy
when: