Webhook basic configuration for Bitbucket
Webhook basic configuration for Bitbucket.
Getting Started
These instructions will get you a clean daemonized webhook installation, ready to execute gulp deploy
when bitbucket receives a push on a certain branch.
Installing
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
Optional (if using gulp and/or git as hook command)
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
Then call your hooks manually or add the hook to bitbicket
Manual trigger: domain:9000/hooks/my-hook-name?token=--some-token-for-manual-deploy--
Bitbucket hook: domain:9000/hooks/my-hook-name
Built With
- Webhook - The webhook project