webhooks/webhook-amogusspecialsauce.sh hinzugefügt

This commit is contained in:
Phil 2023-08-22 20:38:53 +02:00
parent 76fe832e66
commit 5cfb93302c

View file

@ -0,0 +1,45 @@
#!/bin/bash
# Script for webhook artifacts from build-env
# Needs following env:
# DRONE_COMMIT_SHA
# DRONE_TAG
# WEBHOOK_URL
if [[ -n "${DRONE_TAG}" ]]; then
message=$(cat <<EOF
{
"content": null,
"embeds": [
{
"title": "CI-Status AmogusSpecialSauce (prod-build)",
"description": "Download artifacts (valid 90D from now):\nhttps://s3.hackmi.ch/amogusspecialsauce/releases/compiled-${DRONE_TAG}.zip",
"color": 65321
}
],
"attachments": []
}
EOF
)
elif [[ -n "${DRONE_COMMIT_SHA}" ]]; then
message=$(cat <<EOF
{
"content": null,
"embeds": [
{
"title": "CI-Status AmogusSpecialSauce (main-build)",
"description": "Download artifacts (valid 90D from now):\nhttps://s3.hackmi.ch/amogusspecialsauce/b/main/compiled-${DRONE_COMMIT_SHA:0:10}.zip",
"color": 65321
}
],
"attachments": []
}
EOF
)
else
exit 1
fi
curl -d "${message}" -H "Content-Type: application/json" "${WEBHOOK_URL}"