I am following a tutorial on deploying a Node.js app onto the Amazon service with GitHub's webhook.
On the Amazon server, I have created a repository named hook, and initialized it as a GitHub repository
$ mkdir hook
$ cd hook
$ git init --bare
Then I created a githook
$ cat > hooks/post-receive
GIT_WORK_TREE=/home/ubuntu/myapp git checkout -f
echo "Installing dependencies..."
cd /home/ubuntu/myapp
npm install
echo "Restarting node.js..."
$ chmod +x hooks/post-receive
I think this is done on the server side, so I go back to the GitHub repository and add a WebHook URL. But I don't know how to fill in this URL, so I input
ssh://[email protected]/home/ubuntu/hook
which I think it is not right.
I commit and push my local repository on Windows platform, so as expected nothing is received on the Amazon server side.
I think it is probably due to the wrong webhook URL input at the GitHub repository setting, what do you think?
Do I have to set up a server with a URL in order to receive the updates and execute the bash?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…