Webhook basic configuration for Bitbucket.
These instructions will get you a clean daemonized webhook installation, ready to execute gulp deploy
when bitbucket receives a push on a certain branch.
Webhook (binary at /usr/bin/webhook
and configuration file at /etc/hooks.json
)
wget https://gist.githubusercontent.com/ogero/26f5739da3451134ac13d34097a16521/raw/webhook-install.sh?r=2 && chmod +x webhook-install.sh && ./webhook-install.sh
Configure your hooks.
nano /etc/hooks.json
Gulp
curl -sL https://deb.nodesource.com/setup_7.x | sudo -E bash -
sudo apt-get install -y nodejs
npm install -g gulp
Add an identity key to ssh config allowing user running webhook to acces the repo.
nano /root/.ssh/config
Host bitbucket.org
IdentityFile ~/.ssh/some_private_key
chmod 0400 ~/.ssh/some_private_key
Manual trigger: domain:9000/hooks/my-hook-name?token=--some-token-for-manual-deploy--
Bitbucket hook: domain:9000/hooks/my-hook-name
- Webhook - The webhook project