From 01a7c119eabf9e21a67bd9df6f652c657c675a02 Mon Sep 17 00:00:00 2001 From: Riku Rouvila Date: Tue, 5 Mar 2024 14:07:08 +0200 Subject: [PATCH] send an email to verify successful deployment --- infrastructure/deployment/deploy.sh | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/infrastructure/deployment/deploy.sh b/infrastructure/deployment/deploy.sh index ea3e8e809..2823450bd 100755 --- a/infrastructure/deployment/deploy.sh +++ b/infrastructure/deployment/deploy.sh @@ -370,4 +370,17 @@ while true; do break fi sleep 5 -done \ No newline at end of file +done + +# Send a notification email to confirm emails are working +EMAIL_PAYLOAD='{ + "subject": "Deployment to '$ENV' finished", + "html": "Deployment to '$ENV' was successful with images '$VERSION' for core and '$COUNTRY_CONFIG_VERSION' for country config.", + "from": "{{SENDER_EMAIL_ADDRESS}}", + "to": "{{ALERT_EMAIL}}" +}' + +configured_ssh "docker run --rm --network=opencrvs_overlay_net appropriate/curl \ + -X POST 'http://countryconfig:3040/email' \ + -H 'Content-Type: application/json' \ + -d '$EMAIL_PAYLOAD'" \ No newline at end of file