Capistrano 3 deploy: pure error resolving old releases

I'm trying to deploy a Yii application using capistrino 3. Sever is an EC2 ubuntu instance that comes with the ubuntu user by default. I added an ubuntu user to group www data and attempt to deploy using capistrino 3, but in older versions these runtime files pose some problem.

groups ubuntu ubuntu : ubuntu adm dialout cdrom floppy sudo audio dip www-data video plugdev netdev groups www-data www-data : www-data 

Apache server created some files / folder as

 drwxr-sr-x 2 www-data ubuntu 4096 Oct 12 15:23 CSS drwxr-sr-x 2 www-data ubuntu 4096 Oct 12 15:17 HTML 

When I tried to deploy the new version, it says:

 DEBUG[c9d0212b] rm: cannot remove '/var/www/html/zl/releases/20141012145437/frontend/runtime/CSS/4.5.0,24166bfe16a0cc6bd18d813b83121ef2eaf16545,1.ser': Permission denied 

What could be the workaround? I added the ubuntu user to group www data, but the new files have owners of www data and the ubuntu group. I do not know how this has changed.

+6
source share
2 answers

The solution is to add your deploy user to the www-data group by running the following command:

 sudo usermod -a -G www-data deployer_user_name 

To check user new group , run the following command:

  groups deployer_user_name 

After that, cleaning the capistrano will be smooth;)

+7
source

@NaimRajiv, your operator is right, but my deployer_user_name is ubuntu and has already been added to the www-data group

The problem was that my apache-generated directory has a resolution of 755, so if you want to delete, then when deploying from the ubuntu user, he needs a group permission of 775. I updated my PHP code generation code and it worked.

0
source

Source: https://habr.com/ru/post/976683/


All Articles