How to setup automatic git repository (Bitbucket) updates with our development environment
1. clone with bitbucket manually .
clone https://username:firstname.lastname@example.org/xxxx/yyyyyy.git mybitbucket_bkp
Note:mybitbucket_bkp is the folder which is updated with bitbucket directly.
2.Write a shell script and set a cron-job as given below (ex:testsync.sh) .
#sync with bitbucket
# we get the update from bitbucket to mybitbucket_bkp
# we use rsync to update our development folder (my_dev_store) with excluded files and with excluded folders
rsync -avz –exclude app/config/database.php –exclude app/routes.php –exclude app/storage /mnt/www/mybitbucket_bkp/ /mnt/www/my_dev_store/
#we do composer update if need
sudo composer dumpautoload
3.set the cron job for every 5 minutes
*/5 * * * * cd /mnt/www/test_script/; ./testsync.sh