From 8155df25e58325879d8ee9dba87238080d558a01 Mon Sep 17 00:00:00 2001 From: garrettmills Date: Wed, 28 Oct 2020 11:28:27 -0500 Subject: [PATCH] Make build notifications more verbose --- .drone.yml | 54 +++++++++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 47 insertions(+), 7 deletions(-) diff --git a/.drone.yml b/.drone.yml index c47942f..1bbb219 100644 --- a/.drone.yml +++ b/.drone.yml @@ -95,8 +95,8 @@ steps: event: promote target: production -# =============== NOTIFICATIONS =============== - - name: send success notifications +# =============== BUILD NOTIFICATIONS =============== + - name: send buile success notifications image: plugins/webhook settings: urls: @@ -104,13 +104,16 @@ steps: content_type: application/json template: | { - "title": "Drone-CI [noded-frontend]", - "message": "Build ${DRONE_BUILD_NUMBER} completed successfully.", + "title": "Drone-CI [noded-frontend @ ${DRONE_BUILD_NUMBER}]", + "message": "Build completed successfully. (Changes by ${DRONE_COMMIT_AUTHOR}: ${DRONE_COMMIT_MESSAGE})", "priority": 4 } when: status: success - - name: send error notifications + event: + exclude: + - promote + - name: send build error notifications image: plugins/webhook settings: urls: @@ -118,9 +121,46 @@ steps: content_type: application/json template: | { - "title": "Drone-CI [noded-frontend]", - "message": "Build ${DRONE_BUILD_NUMBER} failed!", + "title": "Drone-CI [noded-frontend @ ${DRONE_BUILD_NUMBER}]", + "message": "Build failed! (Changes by ${DRONE_COMMIT_AUTHOR}: ${DRONE_COMMIT_MESSAGE})", "priority": 6 } when: status: failure + event: + exclude: + - promote + +# =============== DEPLOY NOTIFICATIONS =============== + - name: send deploy success notifications + image: plugins/webhook + settings: + urls: + from_secret: notify_webhook_url + content_type: application/json + template: | + { + "title": "Drone-Deploy [noded-frontend @ ${DRONE_BUILD_NUMBER} to ${DRONE_DEPLOY_TO}]", + "message": "Deployment completed successfully. (Changes by ${DRONE_COMMIT_AUTHOR}: ${DRONE_COMMIT_MESSAGE})", + "priority": 4 + } + when: + status: success + event: + - promote + - name: send deploy error notifications + image: plugins/webhook + settings: + urls: + from_secret: notify_webhook_url + content_type: application/json + template: | + { + "title": "Drone-Deploy [noded-frontend @ ${DRONE_BUILD_NUMBER} to ${DRONE_DEPLOY_TO}]", + "message": "Deployment failed! (Changes by ${DRONE_COMMIT_AUTHOR}: ${DRONE_COMMIT_MESSAGE})", + "priority": 6 + } + when: + status: failure + event: + - promote