Fix discord message
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Tobias Berger 2021-10-14 19:02:05 +02:00
parent c4dbfa6d6c
commit 3152e71ce7

View file

@ -78,81 +78,62 @@ steps:
from_secret: VERCEL_SCOPE from_secret: VERCEL_SCOPE
commands: commands:
- export VERCEL_BUILD_URL=$(vercel -t $VERCEL_TOKEN --scope $VERCEL_SCOPE -c) - export VERCEL_BUILD_URL=$(vercel -t $VERCEL_TOKEN --scope $VERCEL_SCOPE -c)
- echo VERCEL_BUILD_URL=$VERCEL_BUILD_URL >> .env
when: when:
branch: branch:
exclude: exclude:
- main - main
---
kind: pipeline
name: notify
clone:
disable: true
depends_on:
- build
steps:
- name: sync
image: alpine
- name: discord notification (private) - name: discord notification (private)
image: appleboy/drone-discord image: appleboy/drone-discord
settings: environment:
message: | WEBHOOK_ID_PRIVATE:
{{#success build.status}}
```
✅ Build #{{build.number}} of `{{repo.name}}` succeeded.
📝 Commit by {{commit.author}} on `{{commit.branch}}`:
-------------------------------------------------------
{{commit.message}}
-------------------------------------------------------
🌐 {{ build.link }}```
{{else}}
```
❌ Build #{{build.number}} of `{{repo.name}}` failed.
📝 Commit by {{commit.author}} on `{{commit.branch}}`:
-------------------------------------------------------
{{commit.message}}
-------------------------------------------------------
🌐 {{ build.link }}```
{{/success}}"
webhook_id:
from_secret: discord_webhook_id_private from_secret: discord_webhook_id_private
webhook_token: WEBHOOK_TOKEN_PRIVATE:
from_secret: discord_webhook_token_private from_secret: discord_webhook_token_private
commands:
- source .env
- |-
export MESSAGE='{{#success build.status}}
✅ Build #{{build.number}} of `{{repo.name}}` succeeded.{{else}}
❌ Build #{{build.number}} of `{{repo.name}}` failed.{{/success}}
📝 Commit by {{commit.author}} on `{{commit.branch}}`:
```
{{commit.message}}
```
🌐 {{ build.link }}
🌐 '$VERCEL_BUILD_URL
- >-
drone-discord
--webhook-id $WEBHOOK_ID_PRIVATE
--webhook-token $WEBHOOK_TOKEN_PRIVATE
depends_on: depends_on:
- sync - deploy (production)
- deploy (preview)
- name: discord notification (dev server) - name: discord notification (dev server)
image: appleboy/drone-discord image: appleboy/drone-discord
settings: environment:
message: | WEBHOOK_ID_DEV_SERVER:
{{#success build.status}}
```
✅ Build #{{build.number}} of `{{repo.name}}` succeeded.
📝 Commit by {{commit.author}} on `{{commit.branch}}`:
-------------------------------------------------------
{{commit.message}}
-------------------------------------------------------
🌐 {{ build.link }}```
{{else}}
```
❌ Build #{{build.number}} of `{{repo.name}}` failed.
📝 Commit by {{commit.author}} on `{{commit.branch}}`:
-------------------------------------------------------
{{commit.message}}
-------------------------------------------------------
🌐 {{ build.link }}```
{{/success}}"
webhook_id:
from_secret: discord_webhook_id_dev_server from_secret: discord_webhook_id_dev_server
webhook_token: WEBHOOK_TOKEN_DEV_SERVER:
from_secret: discord_webhook_token_dev_server from_secret: discord_webhook_token_dev_server
commands:
- source .env
- |-
export MESSAGE='{{#success build.status}}
✅ Build #{{build.number}} of `{{repo.name}}` succeeded.{{else}}
❌ Build #{{build.number}} of `{{repo.name}}` failed.{{/success}}
📝 Commit by {{commit.author}} on `{{commit.branch}}`:
```
{{commit.message}}
```
🌐 {{ build.link }}
🌐 '$VERCEL_BUILD_URL
- >-
drone-discord
--webhook-id $WEBHOOK_ID_DEV_SERVER
--webhook-token $WEBHOOK_TOKEN_DEV_SERVER
depends_on: depends_on:
- sync - deploy (production)
- deploy (preview)