Handles sending notifications to several services for incoming ciccd-builds pub sub messages.
These messages are usually sent by the forward-service. However, you can also manually publish these. See the readme for ciccd-service for the required attributes in case you want to manually send messages and trigger notifications.
- google chat: done
- jira comments: done
- jira transition issue to new status: done
- github checks: planned
- github comments: planned
- email (using sendgrid api): planned
For google chat and jira comments the notification service allows you to use mustache templates.
{{sha}}
{{{branch}}}
{{{repo}}}
{{status}}
{{{logUrl}}}
{{trigger}}
{{commitAuthor}}
{{commitMessage}}
Example template:
Hi. {{#success}}Great job!{{/success}}{{#failure}}You failed!{{/failure}}
Will print for a succesful build:
Hi. Great job!
And for a a failed build:
Hi. You failed!
{{#lowercase}}{{{branch}}}{{/lowercase}}
Given branch feat/PROJECT-1234
will print feat/project-1234
.
Currently only supported for jira-update notifications.
{{#issueId}}{{{branch}}}{{/issueId}}
Given branch feat/PROJECT-1234-exp
and using default issue id regex [A-Z][A-Z0-9]+-[0-9]+
will print PROJECT-1234
.
Add a .env
file containing your github token.
GITHUB_TOKEN=xxxxxxxxxxxxxxxxxxxxxxxxx
## jira server
JIRA_USER=
JIRA_PASSWORD=
JIRA_HOST=jira-server.your-domain.com
Next build and start the server:
yarn install
yarn build
yarn dev
Edit the file in ./tests/pub-sub-message.json
with the data you would like to test.
Now run trigger.sh
from the ./tests
folder.