Auto git pull for your projects.
cd ~
Clone GitDeploy:
git clone https://github.com/Shchepotin/GitDeploy.git mygitdeploy
cd mygitdeploy
Copy and rename config file:
cp config.conf.sample config.conf
Edit:
nano config.conf
cd /path/to/your/web/site
Create webhook.php
in your project:
nano webhook.php
<?php
putenv("HOME=/home/YOUR_USER_NAME"); // Required
exec("nohup bash /path/to/gitdeploy/webhook.sh >> /path/to/gitdeploy/webhook.log 2>&1 &");
In your repository go to Settings > Webhooks > Add webhook
and set Payload URL
:
http://yoursite.com/webhook.php
And press button Add webhook
In your repository go to Settings > Webhooks > Add webhook
and set URL
:
http://yoursite.com/webhook.php
And press button Save