Skip to content

Commit

Permalink
add hostname to slack notification
Browse files Browse the repository at this point in the history
  • Loading branch information
paulineribeyre committed Mar 7, 2024
1 parent b8cc5d9 commit 77ada14
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions kube/services/jobs/ecr-access-job.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,11 @@ spec:
name: global
key: slack_webhook
optional: true
- name: HOSTNAME
valueFrom:
configMapKeyRef:
name: global
key: hostname
- name: PAY_MODELS_DYNAMODB_TABLE
valueFrom:
configMapKeyRef:
Expand All @@ -70,9 +75,9 @@ spec:
if [[ "${SLACK_WEBHOOK}" != 'None' ]]; then
if [[ $exitcode == 1 ]]; then
curl -X POST --data-urlencode "payload={\"text\": \"JOBFAIL: ECR access job on ${gen3Env}\"}" "${SLACK_WEBHOOK}"
curl -X POST --data-urlencode "payload={\"text\": \"JOBFAIL: ECR access job on ${HOSTNAME}\"}" "${SLACK_WEBHOOK}"
else
curl -X POST --data-urlencode "payload={\"text\": \"SUCCESS: ECR access job on ${gen3Env}\"}" "${SLACK_WEBHOOK}"
curl -X POST --data-urlencode "payload={\"text\": \"SUCCESS: ECR access job on ${HOSTNAME}\"}" "${SLACK_WEBHOOK}"
fi
fi
Expand Down

0 comments on commit 77ada14

Please sign in to comment.