Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save testpilot031/71f8935f455791fa5e40b3e7a5b1ba06 to your computer and use it in GitHub Desktop.
Save testpilot031/71f8935f455791fa5e40b3e7a5b1ba06 to your computer and use it in GitHub Desktop.
webhook.md
# webhook の導入
$ sudo yum install wget
wget https://dl.google.com/go/go1.12.5.linux-amd64.tar.gz
# sudo tar -C /usr/local -xzf go1.12.5.linux-amd64.tar.gz
$ sudo vi ~/.bash_profile
export GOROOT=/usr/local/go
export PATH=$PATH:$GOROOT/bin
$ source ~/.bash_profile
$ sudo yum install git
$ go get github.com/adnanh/webhook
$ cat hooks.json
[
{
"id": "redeploy-webhook",
"execute-command": "/home/ec2-user/redeploy.sh",
"command-working-directory": "/home/ec2-user/go",
"response-message":"it works!\n"
}
]
$ cat hooks-test.json
[
{
"id": "test-file-webhook",
"execute-command": "/bin/ls",
"command-working-directory": "/tmp",
"pass-file-to-command":
[
{
"source": "payload",
"name": "binary",
"envname": "ENV_VARIABLE", // to use $ENV_VARIABLE in execute-command
// if not defined, $HOOK_BINARY will be provided
"base64decode": true, // defaults to false
}
],
"include-command-output-in-response": true
}
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment