test-embed
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
surtur 2020-03-09 07:00:28 +01:00
parent a1e20d11c7
commit a78a10e393
Signed by: wanderer
GPG Key ID: 19CE1EC1D9E0486D

View File

@ -14,7 +14,7 @@ steps:
from_secret: dockerhub_endpoint
commands:
#- curl -s -X POST $ENDPOINT
- echo $ENDPOINT
- echo
---
@ -38,7 +38,8 @@ steps:
webhook_token:
from_secret: discord_webhook_token
commands:
- curl -H "Content-Type:multipart/form-data" -X POST https://discordapp.com/api/webhooks/$webhook_id/$webhook_token -d '{"wait":false,"content":"","username":"","avatar_url":"","tts":false,"embeds":[{"title":":white_check_mark:Build \#${DRONE_BUILD_NUMBER} of `${DRONE_REPO}` succeeded.","description":"event:**`${DRONE_BUILD_EVENT}`**\n\ncommit [`${DRONE_COMMIT_SHA}`](${DRONE_COMMIT_LINK}) on [`${DRONE_COMMIT_BRANCH}`](https://git.dotya.ml/${DRONE_REPO}/src/branch/${DRONE_COMMIT_BRANCH})\n${DRONE_COMMIT_MESSAGE} - ${DRONE_COMMIT_AUTHOR_NAME}\n\n[go to repo](https://${DRONE_SYSTEM_HOST}/${DRONE_REPO})","url":"https://${DRONE_SYSTEM_HOST}/${DRONE_REPO}/${DRONE_BUILD_NUMBER}","color":7506394,"footer":{"text":"drone discord webhook"},"author":{"name":"${DRONE_COMMIT_AUTHOR}","url":"https://git.dotya.ml/${DRONE_COMMIT_AUTHOR}","icon_url":"https://git.dotya.ml/user/avatar/${DRONE_COMMIT_AUTHOR}/-1"},"fields":null}]}'
#- curl -sL -H "Content-Type:application/json" -X POST https://discordapp.com/api/webhooks/$webhook_id/$webhook_token -d '{"wait":false,"content":"","username":"","avatar_url":"","tts":false,"embeds":[{"title":":white_check_mark:Build \#${DRONE_BUILD_NUMBER} of `${DRONE_REPO}` succeeded.","description":"event:**`${DRONE_BUILD_EVENT}`**\n\ncommit [`${DRONE_COMMIT_SHA}`](${DRONE_COMMIT_LINK}) on [`${DRONE_COMMIT_BRANCH}`](https://git.dotya.ml/${DRONE_REPO}/src/branch/${DRONE_COMMIT_BRANCH})\n${DRONE_COMMIT_MESSAGE} - ${DRONE_COMMIT_AUTHOR_NAME}\n\n[go to repo](https://${DRONE_SYSTEM_HOST}/${DRONE_REPO})","url":"https://${DRONE_SYSTEM_HOST}/${DRONE_REPO}/${DRONE_BUILD_NUMBER}","color":7506394,"footer":{"text":"drone discord webhook"},"author":{"name":"${DRONE_COMMIT_AUTHOR}","url":"https://git.dotya.ml/${DRONE_COMMIT_AUTHOR}","icon_url":"https://git.dotya.ml/user/avatar/${DRONE_COMMIT_AUTHOR}/-1"},"fields":null}]}'
- curl -sL -H "Content-Type:application/json" -X POST https://discordapp.com/api/webhooks/$webhook_id/$webhook_token -d '{"content":"Hello, World!","tts":false,"embed":{"title":"Hello, Embed!","description":"This is an embedded message."}}'
trigger:
branch:
- master
@ -74,12 +75,8 @@ steps:
from_secret: discord_webhook_hourly_id
webhook_token:
from_secret: discord_webhook_hourly_token
ENDPOINT: https://discordapp.com/api
#MESSAGE: "{ \"wait\": false, \"content\": \"\", \"username\": \"\", \"avatar_url\": \"\", \"tts\": false, \"embeds\": [ { \"title\": \":white_check_mark: Build #${DRONE_BUILD_NUMBER} of `${DRONE_REPO}` succeeded.\", \"description\": \"event: **`${DRONE_BUILD_EVENT}`**\n\ncommit [`${DRONE_COMMIT_SHA:0:8}`](${DRONE_COMMIT_LINK}) on [`${DRONE_COMMIT_BRANCH}`](${DRONE_REPO_LINK}/src/branch/${DRONE_COMMIT_BRANCH})\n${DRONE_COMMIT_MESSAGE} - ${DRONE_COMMIT_AUTHOR_NAME}\n\n[go to repo](${DRONE_REPO})\", \"url\": \"https://${DRONE_SYSTEM_HOST}/${DRONE_REPO_NAME}/${DRONE_BUILD_NUMBER}\", \"color\": 7506394, \"footer\": { \"text\": \"drone discord webhook\" }, \"author\": { \"name\": \"${DRONE_COMMIT_AUTHOR}\", \"url\": \"https://git.dotya.ml/${DRONE_COMMIT_AUTHOR}\", \"icon_url\": \"https://git.dotya.ml/user/avatar/${DRONE_COMMIT_AUTHOR}/-1\" }, \"fields\": null } ] }"
commands:
#- curl -H "Content-Type: application/json" -X POST $ENDPOINT/webhooks/$webhook_id/$webhook_token -d "{ \"wait\": false, \"content\": \"\", \"username\": \"\", \"avatar_url\": \"\", \"tts\": false, \"embeds\": [ { \"title\": \":white_check_mark: Build #${DRONE_BUILD_NUMBER} of `${DRONE_REPO}` succeeded.\", \"description\": \"event: **`${DRONE_BUILD_EVENT}`**\n\ncommit [`${DRONE_COMMIT_SHA:0:8}`](${DRONE_COMMIT_LINK}) on [`${DRONE_COMMIT_BRANCH}`](${DRONE_REPO_LINK}/src/branch/${DRONE_COMMIT_BRANCH})\n${DRONE_COMMIT_MESSAGE} - ${DRONE_COMMIT_AUTHOR_NAME}\n\n[go to repo](${DRONE_REPO})\", \"url\": \"https://${DRONE_SYSTEM_HOST}/${DRONE_REPO_NAME}/${DRONE_BUILD_NUMBER}\", \"color\": 7506394, \"footer\": { \"text\": \"drone discord webhook\" }, \"author\": { \"name\": \"${DRONE_COMMIT_AUTHOR}\", \"url\": \"https://git.dotya.ml/${DRONE_COMMIT_AUTHOR}\", \"icon_url\": \"https://git.dotya.ml/user/avatar/${DRONE_COMMIT_AUTHOR}/-1\" }, \"fields\": null } ] }"
#- echo $ENDPOINT
#- echo ${DRONE_COMMIT_SHA}
- curl -sL -H "Content-Type:application/json" -X POST https://discordapp.com/api/webhooks/$webhook_id/$webhook_token -d '{"wait":false,"content":"","username":"","avatar_url":"","tts":false,"embeds":[{"title":":white_check_mark:Hourly build \#${DRONE_BUILD_NUMBER} of `${DRONE_REPO}` succeeded.","description":"event:**`${DRONE_BUILD_EVENT}`**\n\ncommit [`${DRONE_COMMIT_SHA}`](${DRONE_COMMIT_LINK}) on [`${DRONE_COMMIT_BRANCH}`](https://git.dotya.ml/${DRONE_REPO}/src/branch/${DRONE_COMMIT_BRANCH})\n${DRONE_COMMIT_MESSAGE} - ${DRONE_COMMIT_AUTHOR_NAME}\n\n[go to repo](https://${DRONE_SYSTEM_HOST}/${DRONE_REPO})","url":"https://${DRONE_SYSTEM_HOST}/${DRONE_REPO}/${DRONE_BUILD_NUMBER}","color":7506394,"footer":{"text":"drone discord webhook"},"author":{"name":"${DRONE_COMMIT_AUTHOR}","url":"https://git.dotya.ml/${DRONE_COMMIT_AUTHOR}","icon_url":"https://git.dotya.ml/user/avatar/${DRONE_COMMIT_AUTHOR}/-1"},"fields":null}]}'
trigger:
event:
- cron