Skip to content

Commit

Permalink
update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
rjeczalik committed Mar 14, 2015
1 parent 1c53564 commit 2ac813a
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,16 +118,16 @@ Notify Slack's channel about recent push:
> EOF
```
```
~ $ webhook -secret secret123 slack.tsc
~ $ SLACK_TOKEN=token SLACK_CHANNEL=channel123 webhook -secret secret123 slack.tsc
```
Notify HipChat's room about recent push:
```bash
~ $ cat >hipchat.tsc <<EOF
~ $ cat >hipchat.tsc <<EOF
> {{with $e := .}}
> {{if eq $e.name "push"}}
> {{with $auth := (printf "authorization: bearer %s" (env "hipchat_token"))}}
> {{with $msg := (printf "{\"message_format\": \"text\", \"message\": \"%s pushed to %s\"}" $e.payload.pusher.email $e.payload.repository.name)}}
> {{with $url := (printf "https://api.hipchat.com/v2/room/%s/notification" (env "hipchat_room"))}}
> {{if eq $e.Name "push"}}
> {{with $auth := (printf "authorization: bearer %s" (env "HIPCHAT_TOKEN"))}}
> {{with $msg := (printf "{\"message_format\": \"text\", \"message\": \"%s pushed to %s\"}" $e.Payload.Pusher.Email $e.Payload.Repository.Name)}}
> {{with $url := (printf "https://api.hipchat.com/v2/room/%s/notification" (env "HIPCHAT_ROOM"))}}
> {{exec "curl" "-h" "content-type: application/json" "-h" $auth "-x" "post" "-d" $msg $url | log}}
> {{end}}
> {{end}}
Expand All @@ -137,7 +137,7 @@ Notify HipChat's room about recent push:
> EOF
```
```
~ $ webhook -secret secret123 hipchat.tsc
~ $ HIPCHAT_TOKEN=token HIPCHAT_ROOM=123 webhook -secret secret123 hipchat.tsc
```
### Troubleshooting
Expand Down

0 comments on commit 2ac813a

Please sign in to comment.