Skip to content
This repository has been archived by the owner on Oct 19, 2024. It is now read-only.

Commit

Permalink
docs: document slack bot (#50)
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexander Matyushentsev authored Mar 2, 2020
1 parent f0d8085 commit b0736c6
Show file tree
Hide file tree
Showing 11 changed files with 88 additions and 8 deletions.
5 changes: 4 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
# Changelog

## v0.5.0 (Not released)
## v0.5.0 (2020-03-01)

### Features
* feat: support managing subscriptions using Slack bot
* feat: support `time.Now()` and `time.Parse(...)` in trigger condition ( thanks to [@HatsuneMiku3939](https://github.com/HatsuneMiku3939) )
* feat: Add icon emoij and icon url support for Slack messages ( thanks to [sboschman](https://github.com/sboschman) )
* feat: Introduce sprig functions to templates( thanks to [imranismail](https://github.com/imranismail) )

### Bug Fixes
* fix: fix null pointer dereference error while config parsing
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

Argo CD Notifications continuously monitors Argo CD applications and provides a flexible way to notify
users about important changes in the applications state. The project includes a bundle of useful
built-in triggers and notification templates and aims to integrate with various notification services such as
☑ Slack, ☑ SMTP, Telegram, Discord, etc.
built-in triggers and notification templates, integrates with various notification services such as
☑ Slack, ☑ SMTP and plans to support Telegram, Discord, etc.

![demo](./docs/demo.gif)

Expand Down
4 changes: 2 additions & 2 deletions bot/slack/slack.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ var commandsHelp = map[string]*texttemplate.Template{
"```{{.cmd}} subscribe <my-app> <optional-trigger>\n" +
"{{.cmd}} subscribe proj:<my-proj> <optional-trigger>```"),
"unsubscribe": mustTemplate("*Unsubscribe current channel*:\n" +
"```{{.cmd}} subscribe <my-app> <optional-trigger>\n" +
"{{.cmd}} subscribe proj:<my-proj> <optional-trigger>```"),
"```{{.cmd}} unsubscribe <my-app> <optional-trigger>\n" +
"{{.cmd}} unsubscribe proj:<my-proj> <optional-trigger>```"),
}

func usageInstructions(query url.Values, command string, err error) string {
Expand Down
Binary file added docs/assets/argo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 14 additions & 0 deletions docs/recipients/bot.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Bot (v0.5)

The optional bot component simplifies managing subscriptions. The end users can use bot commands to manage subscriptions
even if they don't have access to the Kubernetes API and cannot modify annotations.

The bot is not installed by default. Use the `install-bot.yaml` to intall it:

```
kubectl apply -n argocd -f https://raw.githubusercontent.com/argoproj-labs/argocd-notifications/stable/manifests/install-bot.yaml
```

* [Slack bot](./slack-bot.md)
* [Opsgenie bot](./opsgenie-bot.md)
* [Telegram bot](./telegram-bot.md)
7 changes: 7 additions & 0 deletions docs/recipients/opsgenie-bot.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Opsgenie bot

!!! note "Do you need Opsgenie bot? Please consider contributing or create [feature request](https://github.com/argoproj-labs/argocd-notifications/issues/new)!"

<!-- markdownlint-disable MD033 -->
<div style="text-align:center"><img src="../../assets/argo.png" /></div>
<!-- markdownlint-enable MD033 -->
7 changes: 5 additions & 2 deletions docs/recipients.md → docs/recipients/overview.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Recipients
# Overview

The list of recipients is not stored in a centralized configuration file. Instead, recipients might be configured using
`Application` or `AppProject` CRD annotations. The example below demonstrates how to subscribe to the email
Expand All @@ -22,7 +22,7 @@ metadata:
recipients.argocd-notifications.argoproj.io: slack:<sample-channel-name>
```
Each recipient is prefixed with the [notification service type](./services/overview.md) such as `slack` or `email`.
Each recipient is prefixed with the [notification service type](../services/overview.md) such as `slack` or `email`.

## Trigger Specific Subscription (v0.3)

Expand All @@ -38,3 +38,6 @@ metadata:
on-sync-failed.recipients.argocd-notifications.argoproj.io: email:<sample-email>
```

## Manage subscriptions using bots

The [bot](./bot.md) component simplifies managing subscriptions.
33 changes: 33 additions & 0 deletions docs/recipients/slack-bot.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Slack bot (v0.5)

The Slack bot leverages [slash commands](https://api.slack.com/interactivity/slash-commands). The bot allows slack users
to view existing channel subscriptions and subscribe or unsubscribe channels.

1. Make sure bot component is [installed](./bot.md).
1. Configure slack [integration](../services/slack.md).
1. In the slack application settings page navigate to the 'Slash Commands' section and click 'Create New Command' button.
1. Fill in new slack command details
![image](https://user-images.githubusercontent.com/426437/75645798-2e022480-5bfc-11ea-8682-5ce362bdcc9a.png)
1. In the slack application settings page navigate to the 'Basic Information' section and copy 'Signing Secret' from the 'App Credentials' section.
1. Add `signingSecret` to the slack configuration in the `notifiers.yaml` field of the `argocd-notification-secret`:
```yaml
apiVersion: v1
kind: Secret
metadata:
name: argocd-notifications-secret
stringData:
notifiers.yaml: |
slack:
token: <my-token>
signingSecret: <my-secret>
```
## Commands
The bot supports following commands:
* `list-subscriptions` - list channel subscriptions
* `subscribe <my-app> <optional-trigger>` - subscribes channel to the app notifications
* `subscribe proj:<my-app> <optional-trigger>` - subscribes channel to the app project notifications
* `unsubscribe <my-app> <optional-trigger>` - unsubscribes channel frm the app notifications
* `unsubscribe proj:<my-app> <optional-trigger>` - unsubscribes channel frm the app project notifications
7 changes: 7 additions & 0 deletions docs/recipients/telegram-bot.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Telegram bot

!!! note "Do you need Telegram bot? Please consider contributing or create [feature request](https://github.com/argoproj-labs/argocd-notifications/issues/new)!"

<!-- markdownlint-disable MD033 -->
<div style="text-align:center"><img src="../../assets/argo.png" /></div>
<!-- markdownlint-enable MD033 -->
7 changes: 7 additions & 0 deletions docs/services/telegram.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Telegram

!!! note "Do you need Telegram support? Please consider contributing or thumbs up [feature request](https://github.com/argoproj-labs/argocd-notifications/issues/49)!"

<!-- markdownlint-disable MD033 -->
<div style="text-align:center"><img src="../../assets/argo.png" /></div>
<!-- markdownlint-enable MD033 -->
8 changes: 7 additions & 1 deletion mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,11 @@ nav:
- services/overview.md
- services/slack.md
- services/opsgenie.md
- recipients.md
- services/telegram.md
- Recipients:
- recipients/overview.md
- recipients/bot.md
- recipients/slack-bot.md
- recipients/opsgenie-bot.md
- recipients/telegram-bot.md
- built-in.md

0 comments on commit b0736c6

Please sign in to comment.