Skip to content

Commit

Permalink
Merge pull request #11 from timfanda35/docs/update_readme
Browse files Browse the repository at this point in the history
[skip ci] update README
  • Loading branch information
timfanda35 committed Oct 1, 2022
2 parents 62816e8 + 75d22df commit c2cc59b
Showing 1 changed file with 42 additions and 22 deletions.
64 changes: 42 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,28 +12,22 @@ Support channels:
Pre-build container image on [Releases](https://github.com/timfanda35/simple-channel-notify/pkgs/container/simple-channel-notify)

Repository: `ghcr.io/timfanda35/simple-channel-notify`
## Build

Build container image

```
docker build -t simple-channel-notify .
```

## Telegram

Send notify message to Telegram

```
docker run \
-e NOTIFY_TELEGRAM_TOKEN="$NOTIFY_TELEGRAM_TOKEN" \
-e NOTIFY_TELEGRAM_CHAT_ID="$NOTIFY_TELEGRAM_CHAT_ID" \
simple-channel-notify telegram --message="Notify Message~~~"
-e NOTIFY_TELEGRAM_TOKEN="$NOTIFY_TELEGRAM_TOKEN" \
-e NOTIFY_TELEGRAM_CHAT_ID="$NOTIFY_TELEGRAM_CHAT_ID" \
ghcr.io/timfanda35/simple-channel-notify \
telegram --message="Notify Message~~~"
```

Environment Variables
- NOTIFY_TELEGRAM_TOKEN
- NOTIFY_TELEGRAM_CHAT_ID
- `NOTIFY_TELEGRAM_TOKEN`
- `NOTIFY_TELEGRAM_CHAT_ID`

References:

Expand All @@ -46,12 +40,13 @@ Send notify message to Line Notify

```
docker run \
-e NOTIFY_LINE_NOTIFY_TOKEN="$NOTIFY_LINE_NOTIFY_TOKEN" \
simple-channel-notify linenotify --message="Notify Message~~~"
-e NOTIFY_LINE_NOTIFY_TOKEN="$NOTIFY_LINE_NOTIFY_TOKEN" \
ghcr.io/timfanda35/simple-channel-notify \
linenotify --message="Notify Message~~~"
```

Environment Variables
- NOTIFY_LINE_NOTIFY_TOKEN
- `NOTIFY_LINE_NOTIFY_TOKEN`

References:

Expand All @@ -64,8 +59,9 @@ Send notify message to Hangouts Chat

```
docker run \
-e NOTIFY_HANGOUTS_CHAT_WEBHOOK="$NOTIFY_HANGOUTS_CHAT_WEBHOOK" \
simple-channel-notify hangoutschat --message="Notify Message~~~"
-e NOTIFY_HANGOUTS_CHAT_WEBHOOK="$NOTIFY_HANGOUTS_CHAT_WEBHOOK" \
ghcr.io/timfanda35/simple-channel-notify \
hangoutschat --message="Notify Message~~~"
```

Environment Variables
Expand All @@ -81,10 +77,14 @@ Send notify message to Slack Channel

```
docker run \
-e NOTIFY_SLACK_WEBHOOK="$NOTIFY_SLACK_WEBHOOK" \
simple-channel-notify slack --message="Notify Message~~~"
-e NOTIFY_SLACK_WEBHOOK="$NOTIFY_SLACK_WEBHOOK" \
ghcr.io/timfanda35/simple-channel-notify \
slack --message="Notify Message~~~"
```

Environment Variables
- `NOTIFY_SLACK_WEBHOOK`

References:

- [Incoming Webhooks for Slack](https://slack.com/intl/en-tw/help/articles/115005265063-Incoming-Webhooks-for-Slack)
Expand All @@ -95,19 +95,25 @@ Send notify message to Discord Text Channel

```
docker run \
-e NOTIFY_DISCORD_WEBHOOK="$NOTIFY_DISCORD_WEBHOOK" \
simple-channel-notify discord --message="Notify Message~~~"
-e NOTIFY_DISCORD_WEBHOOK="$NOTIFY_DISCORD_WEBHOOK" \
ghcr.io/timfanda35/simple-channel-notify \
discord --message="Notify Message~~~"
```

Environment Variables
- NOTIFY_DISCORD_WEBHOOK
- `NOTIFY_DISCORD_WEBHOOK`

References:

- [Webhook Resource](https://discord.com/developers/docs/resources/webhook#execute-webhook)

## GitLab CI Config Sample

Set the required environment variables in GitLab `Settings -> CI/CD -> Variables` page.

- `NOTIFY_TELEGRAM_TOKEN`
- `NOTIFY_TELEGRAM_CHAT_ID`

`.gitlab-ci.yml`

```
Expand All @@ -123,6 +129,9 @@ notify-telegram:
- /app telegram --message="Message from GitLab CI"
```

Reference:
https://docs.gitlab.com/ee/ci/yaml/gitlab_ci_yaml.html

## Google Cloud Build Config Sample

`cloudbuild.yaml`
Expand All @@ -135,3 +144,14 @@ steps:
- 'NOTIFY_TELEGRAM_TOKEN=${_NOTIFY_TELEGRAM_TOKEN}'
- 'NOTIFY_TELEGRAM_CHAT_ID=${_NOTIFY_TELEGRAM_CHAT_ID}'
```

Reference:
https://cloud.google.com/build/docs/configuring-builds/substitute-variable-values#using_user-defined_substitutions

## Local Build

Build container image

```
docker build -t simple-channel-notify .
```

0 comments on commit c2cc59b

Please sign in to comment.