Created
June 2, 2019 09:51
-
-
Save testpilot031/71f8935f455791fa5e40b3e7a5b1ba06 to your computer and use it in GitHub Desktop.
webhook.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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