-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add
send_slack_message_using_cron
mod (#29)
- Loading branch information
1 parent
92ed6c5
commit 985e82d
Showing
5 changed files
with
75 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# Send Slack Message Using Cron | ||
|
||
Send a message to a Slack channel every minute using cron. | ||
|
||
## Usage | ||
|
||
- Add your Slack API token, Channel and Message to `flowpipe.pvars` | ||
- Run the `flowpipe server` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
slack_token = "xoxb-2556146250-5954" | ||
slack_channel = "mychannel" | ||
message = "test trigger 1 min" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
mod "send_slack_message_using_cron" { | ||
title = "Send Slack Message Using Cron" | ||
description = "Send a message to a Slack channel every minute using cron." | ||
|
||
require { | ||
mod "github.com/turbot/flowpipe-mod-slack" { | ||
version = "0.0.1-rc.2" | ||
args = { | ||
token = var.slack_token | ||
} | ||
} | ||
} | ||
} |
37 changes: 37 additions & 0 deletions
37
simple/send_slack_message_using_cron/send_slack_message_using_cron.fp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
trigger "schedule" "send_slack_message_using_cron" { | ||
description = "Send a message to a Slack channel every minute using cron." | ||
schedule = "* * * * *" | ||
pipeline = pipeline.send_slack_message_using_cron | ||
} | ||
|
||
pipeline "send_slack_message_using_cron" { | ||
title = "Send Slack Message Using Cron" | ||
description = "Send a message to a Slack channel every minute using cron." | ||
|
||
param "slack_token" { | ||
type = string | ||
description = "Authentication token bearing required scopes." | ||
default = var.slack_token | ||
} | ||
|
||
param "slack_channel" { | ||
type = string | ||
description = "Channel, private group, or IM channel to send message to." | ||
default = var.slack_channel | ||
} | ||
|
||
param "message" { | ||
type = string | ||
description = "Message to be sent." | ||
default = var.message | ||
} | ||
|
||
step "pipeline" "post_message" { | ||
pipeline = slack.pipeline.post_message | ||
args = { | ||
token = param.slack_token | ||
channel = param.slack_channel | ||
message = param.message | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
variable "slack_token" { | ||
type = string | ||
description = "Slack app token used to authenticate to your Slack workspace." | ||
} | ||
|
||
variable "slack_channel" { | ||
type = string | ||
description = "Channel, private group, or IM channel to send message to." | ||
} | ||
|
||
variable "message" { | ||
type = string | ||
description = "Message to be sent." | ||
} |