Test with posts API and bot
This commit is contained in:
@@ -33,14 +33,33 @@ steps:
|
|||||||
MATTERMOST_BOT_ACCESS_TOKEN:
|
MATTERMOST_BOT_ACCESS_TOKEN:
|
||||||
from_secret: mattermost_bot_access_token
|
from_secret: mattermost_bot_access_token
|
||||||
commands:
|
commands:
|
||||||
|
# - |
|
||||||
|
# BODY=$(printf '{"username":"WoodpeckerBot","text":"[%s - Build #%s] Lint failure 💩"}' "$CI_REPO" "$CI_PIPELINE_NUMBER")
|
||||||
|
# curl -sS -X POST -H "Content-Type: application/json" -d "$BODY" -H "Authorization: Bearer $MATTERMOST_BOT_ACCESS_TOKEN" "$MATTERMOST_WEBHOOK_URL"
|
||||||
- |
|
- |
|
||||||
BODY=$(printf '{"username":"WoodpeckerBot","text":"[%s - Build #%s] Lint failure 💩"}' "$CI_REPO" "$CI_PIPELINE_NUMBER")
|
BODY=$(printf '{"channel_id":"qgg5yxg67y85q53syijgj4ase","message":"[%s - Build #%s] Lint failure 💩"}' "$CI_REPO" "$CI_PIPELINE_NUMBER")
|
||||||
curl -sS -X POST -H "Content-Type: application/json" -d "$BODY" -H "Authorization: Bearer $MATTERMOST_BOT_ACCESS_TOKEN" "$MATTERMOST_WEBHOOK_URL"
|
curl -sS -X POST -H "Content-Type: application/json" -d "$BODY" -H "Authorization: Bearer $MATTERMOST_BOT_ACCESS_TOKEN" https://labs.mifi.dev/api/v4/posts
|
||||||
depends_on:
|
depends_on:
|
||||||
- lint
|
- lint
|
||||||
when:
|
when:
|
||||||
- status: [failure]
|
- status: [failure]
|
||||||
|
|
||||||
|
- name: Send Lint Status Notification (success)
|
||||||
|
image: curlimages/curl
|
||||||
|
environment:
|
||||||
|
MATTERMOST_WEBHOOK_URL:
|
||||||
|
from_secret: mattermost_test_webhook
|
||||||
|
MATTERMOST_BOT_ACCESS_TOKEN:
|
||||||
|
from_secret: mattermost_bot_access_token
|
||||||
|
commands:
|
||||||
|
- |
|
||||||
|
BODY=$(printf '{"channel_id":"qgg5yxg67y85q53syijgj4ase","message":"[%s - Build #%s] Lint success 🎉"}' "$CI_REPO" "$CI_PIPELINE_NUMBER")
|
||||||
|
curl -sS -X POST -H "Content-Type: application/json" -d "$BODY" -H "Authorization: Bearer $MATTERMOST_BOT_ACCESS_TOKEN" https://labs.mifi.dev/api/v4/posts
|
||||||
|
depends_on:
|
||||||
|
- lint
|
||||||
|
when:
|
||||||
|
- status: [success]
|
||||||
|
|
||||||
- name: build
|
- name: build
|
||||||
image: node:20-alpine
|
image: node:20-alpine
|
||||||
commands:
|
commands:
|
||||||
|
|||||||
Reference in New Issue
Block a user