notify
Supports Discord & Slack.Installation
dagger install github.com/gerhard/daggerverse/notify@v0.4.1
Entrypoint
Return Type
Notify
Example
dagger -m github.com/gerhard/daggerverse/notify@3cb1cd957782f7b841f6fc49a662073180021a29 call \
func (m *myModule) example() *Notify {
return dag.
Notify()
}
@function
def example() -> dag.Notify:
return (
dag.notify()
)
@func()
example(): Notify {
return dag
.notify()
}
Types
Notify 🔗
discord() 🔗
Message a Discord webhook: dagger call discord --webhook-url=env:DISCORD_WEBHOOK --message="đź‘‹ from Dagger notify module"
Return Type
String !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
webhookUrl | Secret ! | - | No description provided |
message | String ! | - | No description provided |
Example
dagger -m github.com/gerhard/daggerverse/notify@3cb1cd957782f7b841f6fc49a662073180021a29 call \
discord --webhook-url env:MYSECRET --message string
func (m *myModule) example(ctx context.Context, webhookUrl *Secret, message string) string {
return dag.
Notify().
Discord(ctx, webhookUrl, message)
}
@function
async def example(webhook_url: dagger.Secret, message: str) -> str:
return await (
dag.notify()
.discord(webhook_url, message)
)
@func()
async example(webhookUrl: Secret, message: string): Promise<string> {
return dag
.notify()
.discord(webhookUrl, message)
}
slack() 🔗
Message a specific Slack channel: dagger call slack --token=env:SLACK_TOKEN --channel-id=C07PBDE3U57 --color="#FC0" --message="đź‘‹ from Dagger notify module"
Return Type
String !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
token | Secret ! | - | The slack token to authenticate with the slack organization |
color | String ! | - | The sidebar color of the message |
message | String ! | - | The content of the notification to send |
channelId | String ! | - | The channel where to post the message |
title | String | - | Set a title to the message |
footer | String | - | Set a footer to the message |
footerIcon | String | - | Set an icon in the footer, the icon should be a link |
imageUrl | String | - | Add an image in the message |
threadId | String | - | The thread id if we want to reply to a message or in a thread |
Example
dagger -m github.com/gerhard/daggerverse/notify@3cb1cd957782f7b841f6fc49a662073180021a29 call \
slack --token env:MYSECRET --color string --message string --channel-id string
func (m *myModule) example(ctx context.Context, token *Secret, color string, message string, channelId string) string {
return dag.
Notify().
Slack(ctx, token, color, message, channelId)
}
@function
async def example(token: dagger.Secret, color: str, message: str, channel_id: str) -> str:
return await (
dag.notify()
.slack(token, color, message, channel_id)
)
@func()
async example(token: Secret, color: string, message: string, channelId: string): Promise<string> {
return dag
.notify()
.slack(token, color, message, channelId)
}
daggerCloudTraceUrl() 🔗
helper to return a dagger cloud trace link from the OTEL data in ctx. useful as input to “message” to link your slack or discord notification back up to dagger cloud.
Return Type
String !
Example
dagger -m github.com/gerhard/daggerverse/notify@3cb1cd957782f7b841f6fc49a662073180021a29 call \
dagger-cloud-trace-url
func (m *myModule) example(ctx context.Context) string {
return dag.
Notify().
DaggerCloudTraceUrl(ctx)
}
@function
async def example() -> str:
return await (
dag.notify()
.dagger_cloud_trace_url()
)
@func()
async example(): Promise<string> {
return dag
.notify()
.daggerCloudTraceUrl()
}