From b05d0413b1ee64895d33692f68b848ab8cacbc40 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dawid=20Wysoki=C5=84ski?= Date: Sat, 1 Jul 2023 14:14:58 +0200 Subject: [PATCH] feat: ci/cd - email notifications --- .drone.yml | 58 +++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 57 insertions(+), 1 deletion(-) diff --git a/.drone.yml b/.drone.yml index 74da665..3f02ef7 100644 --- a/.drone.yml +++ b/.drone.yml @@ -42,6 +42,24 @@ steps: auto_tag: true auto_tag_suffix: linux-amd64 dockerfile: Dockerfile + - name: notify + image: drillster/drone-email + settings: + from.address: + from_secret: email_from + from.name: Drone + host: + from_secret: email_host + username: + from_secret: email_username + password: + from_secret: email_password + recipients: + - notifications@dwysokinski.me + recipients_only: true + when: + status: + - failure trigger: event: @@ -73,6 +91,24 @@ steps: from_secret: docker_username password: from_secret: docker_password + - name: notify + image: drillster/drone-email + settings: + from.address: + from_secret: email_from + from.name: Drone + host: + from_secret: email_host + username: + from_secret: email_username + password: + from_secret: email_password + recipients: + - notifications@dwysokinski.me + recipients_only: true + when: + status: + - failure trigger: event: @@ -96,6 +132,26 @@ steps: - "mkdir ~/.kube && echo \"$KUBECONFIG\" > ~/.kube/twhelp" - "cd ./k8s/overlays/prod && kustomize edit set image scripts=gitea.dwysokinski.me/twhelp-packages/scripts:${DRONE_TAG##v} && cd ../../.." - kustomize build ./k8s/overlays/prod | kubectl --kubeconfig ~/.kube/twhelp apply -n twhelp -f - + - name: notify + image: drillster/drone-email + settings: + from.address: + from_secret: email_from + from.name: Drone + host: + from_secret: email_host + username: + from_secret: email_username + password: + from_secret: email_password + recipients: + - notifications@dwysokinski.me + recipients_only: true + subject: "[deploy - {{ build.status }}] {{ repo.owner }}/{{ repo.name }} ({{ build.branch }} - {{ truncate build.commit 8 }})" + when: + status: + - success + - failure trigger: event: @@ -106,6 +162,6 @@ depends_on: --- kind: signature -hmac: f14e13d1782246c39f20905e9caa2b73ebf7f9bc2f53335ad3659801fffc1675 +hmac: 7d871aa28a97b39f7c567f55700bffcb2919a8b7caf9e232bf99b6a045b15369 ...