-
Notifications
You must be signed in to change notification settings - Fork 144
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[enhancement]Customize Slack Notification message #32
Comments
I vouch for this feature! It would be very useful because the message that are displayed now are very generic. |
I agree. Having more details will be useful in slack notifications. We have multiple triggers and today in slack we don't know which one triggered the build. |
Hi all, we on the Cloud Build team are definitely aware of this FR and are working on short-term and long-term plans! Please stay tuned... |
Sure, but I really do appreciate for your contribution 😄 Would using Golang templates satisfy your use case? Do you have any preference between that templating language and Mustache for example? We are considering a few different options for templating. |
Personally I don't have preference as the goal is pretty simple. The PR used go templates because it was convenient and in stdlib ;) |
@LOZORD Hi, I've been waiting for this feature for quite some time, any progress? |
If the GCP version of this will not be available soon, I propose just merging #91. It's a simple enough PR that it probably wouldn't be difficult for the GCP team to make their implementation compatible or at least make it fail gracefully if the implementation changes. |
Any updates on something like this? |
Hi (Not) Noah, |
Thanks for the update! 😃 this will be very useful once released! |
It seems that the request is indeed fulfilled. However, you can checkout the latest code and build your own image and push that in your repository or whatever. From the code, the configuration looks like it should be this: apiVersion: cloud-build-notifiers/v1
kind: SlackNotifier
metadata:
name: cloud-build-slack-notifier
spec:
notification:
template:
type: golang
uri: gs://foo/bar
filter: ...
delivery:
webhookUrl:
secretRef: webhook-url
secrets:
- name: webhook-url
value: .... The |
Hi @jfragoulis , Could you let me know the example value for |
|
Building an updated image solved my problem. Thank you for pointing it out. |
Not sure if it's because I asked on Slack or another reason, but got built today: |
Even though it got built today, the Slack color issue mentioned in #139 and #137 caused it to not work 100%. @jfragoulis: we were able to use our own build of a fork of the upstream repo along with your changes from #139, and it works perfectly; it would be great to see this fix incorporated and built so that we don't have to, so hopefully someone from the team that manages this project will review it soon. I'll let @deriegle comment with an example of a working template, as there were some bits of getting it to work that were a little non-obvious. Other question: is |
As @wyardley mentioned, we were able to get this working with the changes from PR #139. This is our template file. Make sure to change [
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "*Status:* {{.Build.Status}}\n*Repo:* <https://github.com/{orgName}/{{.Build.Substitutions.REPO_NAME}}|{{.Build.Substitutions.REPO_NAME}}>\n*Commit:* <https://github.com/{orgName}/{{.Build.Substitutions.REPO_NAME}}/commit/{{.Build.Substitutions.COMMIT_SHA}}|{{.Build.Substitutions.SHORT_SHA}}>"
},
"accessory": {
"type": "button",
"text": {
"type": "plain_text",
"text": "View Job"
},
"value": "click_me_123",
"url": "{{.Build.LogUrl}}",
"action_id": "button-action"
}
}
] Example configuration: spec:
notification:
template:
type: golang
uri: gs://my-bucket/my-slack-template.json |
The updates have now also been published / built. Thinking maybe this request can be closed now? |
I want custom notification message.
Now it is very simple message, I can't specify which trigger was pushed when using multiple CloudBuild settings.
If there are these option , It will be very useful.
The text was updated successfully, but these errors were encountered: