Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

capistrano deploy_to does not work when set in a stage config file

Tags:

capistrano

I place the set :deploy_to in each of the stage config files: config/deploy/production.rb and config/deploy/staging.rb

Example:

set :deploy_to, '/home/user/htdocs/app-name'

After running cap staging deploy:check --trace I can see that this value was not applied:

...
** Execute deploy:check:directories
 INFO [91f6713c] Running /usr/bin/env mkdir -pv /var/www/shared /var/www/releases on example.net
DEBUG [91f6713c] Command: /usr/bin/env mkdir -pv /var/www/shared /var/www/releases
...

I use a basic capistrano structure:

├── Capfile
├── config
│   ├── deploy
│   │   ├── production.rb
│   │   └── staging.rb
│   └── deploy.rb
└── lib
    └── capistrano
            └── tasks

I thought that those stage config files are there to define custom variables for each stage? Which variables can I set in the stage config files?

EDIT:

I'm using capistrano v3

like image 859
czerasz Avatar asked Dec 03 '13 16:12

czerasz


1 Answers

this seems old, but for my case, i was using capistrano3-puma gem.

i realize ive set my puma config in deploy.rb, but my deploy_to is set in staging.rb and production.rb.

adding puma deploy config in staging.rb after deploy_to works!

eg:

set :deploy_to, "/home/username/rails-stg"
set :puma_conf, "#{shared_path}/puma.rb"
set :puma_default_control_app, "unix://#{shared_path}/tmp/sockets/pumactl.sock"
set :puma_preload_app, true
set :puma_bind, %w(tcp://127.0.0.1:3065)
like image 198
James Tan Avatar answered Oct 31 '22 04:10

James Tan