-
Notifications
You must be signed in to change notification settings - Fork 0
Dynamic Templates
It is possible to dynamically write or create a Glue orb template as a part of the job the orb is running in, and then have the orb pick up that template at the time of sending the notification.
This means it is possible to write orbs that can be used with the Glue orb to send special notifications.
Either within your config or as a part of your orb's command, write to a file your orb template.
You can structure your template using Markdown for message formatting instead of Block Kit.
- Generate orb template
- Write to
/tmp/MyOrbName/GlueTemplate.md
With your template file in the system, we can now export the template as an environment variable. On CircleCI, we need to make use of the $BASH_ENV
environment variable to persist our environment across steps.
echo 'export MY_ORB_TEMPLATE=$(cat /tmp/MyOrbName/GlueTemplate.md)' >> $BASH_ENV
You may now use the template within the Glue orb later in the job as if it were any of the included default templates.
- glue/notify:
event: fail
template: MY_ORB_TEMPLATE
target: thr_ABC123