Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

cap deploy:setup creates the release folder with root as owner

Tags:

capistrano

I am using capistrano to deplay my rails application on a Ubuntu server.

I already logged into the server and created a folder /webapps/myapp, but no sub folders from here.

Then I run

cap deploy:setup

No errors so far, so i run

cap deploy:setup

Now I get this message

You do not have permissions to write to /webapps/myapp/releases

I can get around this by logging in to the server and change the owner of releases, I just wonder why it is not created with the user I use for deploying? Is this how it work or am I missing something?

like image 732
Jepzen Avatar asked Jan 30 '13 07:01

Jepzen


People also ask

How do you know if Capistrano deploys?

If you are not developing a gem, but simply using Capistrano to deploy an application: Your deployment will be unique to your particular project, based on a combination of various Capistrano gems, configuration, server environment, etc. The only real way to test your deployment is by using a staging environment.

What is Capistrano gem?

Capistrano is a utility and framework for executing commands in parallel on multiple remote machines, via SSH.


1 Answers

In your deploy.rb file you should specify the deployment user and if he has sudo privilege.

set :user, "william"
set :use_sudo, false

Giving sudo privilege isn't recommended, but this option exists.

The directory to which you deploy should be already owned by the deployment user "william"

like image 195
Zack Xu Avatar answered Sep 30 '22 04:09

Zack Xu