Answer the question
In order to leave comments, you need to log in
Why doesn't deploy from bitbucket work?
Followed the instructions: jonathannicol.com/blog/2013/11/19/automated-git-de...
VPS server, Ubuntu 14.04
I did it on a test subdomain - everything works.
To celebrate, I immediately deleted everything and decided to do the same on the main one, with improvements.
Did not work out.
Now back to a simple version with a test subdomain.
And so, there is a private repository on bitbucket, 2 Deployment keys have been added:
1. For the username user (located in /home/username/.ssh)
2. For the www-data user (Apache runs under it, lies in /var/www)
There is only 1 file in the repository - index.php
Then I follow strictly according to the instructions, changing only the paths in bitbucket-hook.php (I also tried to change for git). Well, I only have a branch master
After executing the commands
git clone --mirror [email protected]:username/deploy.git
cd deploy.git
GIT_WORK_TREE=/var/www/deploy.example.com git checkout -f master
sudo chown -R username:www-data /var/www
sudo chown -R username:www-data deploy.git
cd ~/deploy.git
git fetch
GIT_WORK_TREE=/var/www/deploy.example.com git checkout -f
Answer the question
In order to leave comments, you need to log in
Thanks to @DancingOnWater for the idea about the broken chown, helped me come up with a solution.
I came to the conclusion that you need to do all the actions from the www-data user, that is:
-
generate an ssh key and config for it
- create a folder for the repository and clone the
repository the folder with the git repository, and www-data should belong to /var/www (and I specified username/www-data).
I checked the solution on a clean installation of the server, everything works. Maybe I'll make a manual if anyone needs it.
I suspect that the repository from which the commit comes and the repository where the bitbuket should be merged is the same
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question