API to post messages to slack, waiting for a CircleCI workflow to complete if required
4.0K
CI plugin to post messages to Slack or other chat clients with Slack compatible incoming webhooks like Rocket.Chat
The following parameters/secrets can be set to configure the plugin.
DRONE_BUILD_STATUS, the syntax will be {{.DroneBuildStatus}}The following secret values can be set to configure the plugin.
Execute from the working directory:
docker run --rm \
-e SLACK_WEBHOOK=https://hooks.slack.com/services/... \
-e PARAMETER_COLOR=#33ad7f \
-e PARAMETER_TEXT="Success: {{.BuildLink}} ({{.BuildRef}}) by {{.BuildAuthor}}" \
-e PARAMETER_CHANNEL="xyz" \
-e PARAMETER_TITLE="Build completed" \
-e BUILD_REF="refs/heads/master" \
-e BUILD_AUTHOR=octocat \
-e BUILD_LINK=http://github.com/octocat/hello-world \
devatherock/simple-slack:latest
pipeline:
notify_slack:
when:
event: [ push ]
status: [ success, failure, error ]
image: devatherock/simple-slack:latest
secrets: [ slack_webhook ]
settings:
color: "#33ad7f"
text: |-
{{.DroneBuildStatus}} {{.DroneBuildLink}} ({{.DroneCommitRef}}) by {{DroneCommitAuthor}}
{{.DroneCommitMessage}}
steps:
- name: notify_slack
ruleset:
event: [ push ]
status: [ success ]
image: devatherock/simple-slack:latest
secrets: [ slack_webhook ]
parameters:
color: "#33ad7f"
text: |-
Success: {{.BuildLink}} ({{.BuildRef}}) by {{.BuildAuthor}}
{{.BuildMessage}}
Content type
Image
Digest
sha256:e3d5b71ce…
Size
9.8 MB
Last updated
18 days ago
docker pull devatherock/simple-slack-api