2020-03-02 02:35:07 +01:00
|
|
|
---
|
|
|
|
kind: pipeline
|
2020-03-02 20:43:23 +01:00
|
|
|
name: dockerhub-build-trigger
|
2020-03-02 02:35:07 +01:00
|
|
|
|
|
|
|
platform:
|
|
|
|
arch: amd64
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: call webhook
|
2020-03-02 22:11:33 +01:00
|
|
|
pull: always
|
2020-03-02 02:35:07 +01:00
|
|
|
image: curlimages/curl
|
|
|
|
environment:
|
|
|
|
ENDPOINT:
|
|
|
|
from_secret: dockerhub_endpoint
|
|
|
|
commands:
|
2020-03-09 04:36:24 +01:00
|
|
|
#- curl -s -X POST $ENDPOINT
|
|
|
|
- echo $ENDPOINT
|
2020-03-02 20:43:23 +01:00
|
|
|
|
|
|
|
|
|
|
|
---
|
|
|
|
kind: pipeline
|
|
|
|
name: notifications
|
|
|
|
|
|
|
|
platform:
|
|
|
|
os: linux
|
|
|
|
arch: amd64
|
|
|
|
|
2020-03-09 02:00:38 +01:00
|
|
|
clone:
|
|
|
|
disable: true
|
|
|
|
|
2020-03-02 20:43:23 +01:00
|
|
|
steps:
|
2020-03-09 01:43:10 +01:00
|
|
|
- name: discord
|
|
|
|
pull: always
|
|
|
|
image: curlimages/curl
|
|
|
|
environment:
|
|
|
|
webhook_id:
|
|
|
|
from_secret: discord_webhook_id
|
|
|
|
webhook_token:
|
|
|
|
from_secret: discord_webhook_token
|
|
|
|
commands:
|
2020-03-09 05:20:13 +01:00
|
|
|
# - echo $MESSAGE
|
2020-03-09 05:56:19 +01:00
|
|
|
- 'curl -v -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}]}'
|
2020-03-09 01:55:08 +01:00
|
|
|
trigger:
|
|
|
|
branch:
|
|
|
|
- master
|
|
|
|
- "release/*"
|
|
|
|
event:
|
|
|
|
- push
|
|
|
|
- tag
|
|
|
|
status:
|
|
|
|
- success
|
|
|
|
- failure
|
2020-03-02 22:11:33 +01:00
|
|
|
|
2020-03-09 02:09:03 +01:00
|
|
|
depends_on:
|
|
|
|
- dockerhub-build-trigger
|
|
|
|
|
2020-03-02 22:11:33 +01:00
|
|
|
|
|
|
|
---
|
|
|
|
kind: pipeline
|
|
|
|
name: notifications-cronbuild
|
|
|
|
|
|
|
|
platform:
|
|
|
|
os: linux
|
|
|
|
arch: amd64
|
|
|
|
|
|
|
|
clone:
|
|
|
|
disable: true
|
|
|
|
|
2020-03-09 02:09:03 +01:00
|
|
|
steps:
|
|
|
|
- name: discord
|
|
|
|
pull: always
|
|
|
|
image: curlimages/curl
|
|
|
|
environment:
|
|
|
|
webhook_id:
|
|
|
|
from_secret: discord_webhook_hourly_id
|
|
|
|
webhook_token:
|
|
|
|
from_secret: discord_webhook_hourly_token
|
2020-03-09 03:00:48 +01:00
|
|
|
ENDPOINT: https://discordapp.com/api
|
2020-03-09 03:04:31 +01:00
|
|
|
#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 } ] }"
|
2020-03-09 02:09:03 +01:00
|
|
|
commands:
|
2020-03-09 05:25:44 +01:00
|
|
|
#- 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}
|
2020-03-02 22:11:33 +01:00
|
|
|
trigger:
|
|
|
|
event:
|
|
|
|
- cron
|
|
|
|
cron:
|
|
|
|
- hourly
|
2020-03-02 22:31:12 +01:00
|
|
|
- hourly-build
|
2020-03-02 22:11:33 +01:00
|
|
|
status:
|
|
|
|
- success
|
|
|
|
- failure
|
|
|
|
|
|
|
|
depends_on:
|
|
|
|
- dockerhub-build-trigger
|