Note that there are some explanatory texts on larger screens.

plurals
  1. POCapistrano multistage - not creating dev/prod symlinks (only 'current')
    text
    copied!<p>I've set this up before but can't get it to work now. I want a development and production site. When I do cap deploy it'll setup a "current" symlink (not sure how I did that since for a long time it wouldn't even do that). But how do I get it to deploy and setup the necessary symlink for dev/prod? </p> <p>My deploy.rb file:</p> <pre><code>#require 'bundler/capistrano' require 'capistrano/ext/multistage' require 'capistrano_colors' set :stages, %w(development production) set :default_stage, 'development' set :application, "myapp" set :repository, "***" # Target directory on the server set :deploy_to, "/var/www/#{application}" set :scm, :git set :deploy_via, :remote_cache set :user, '***' set :use_sudo, false role :web, "68.225.130.30" # Your HTTP server, Apache/etc role :app, "68.225.130.30" # This may be the same as your `Web` server role :db, "68.225.130.30", :primary =&gt; true # This is where Rails migrations will run # List of symlinks to be generated. Keys are subdirectories of release_path. SYMLINKS = { :config =&gt; ['database.yml'], :public =&gt; ['system'] } namespace :deploy do task :start do ; end task :stop do ; end task :restart, :roles =&gt; :app, :except =&gt; { :no_release =&gt; true } do run "#{try_sudo} touch #{File.join(current_path,'tmp','restart.txt')}" # Not working =/ #run "touch /var/www/#{current_path}/tmp/restart.txt" end desc "Set up application symlinks." task :app_symlinks do SYMLINKS.keys.each do |key| dir = key.to_s SYMLINKS[key].each do |path| run "ln -nfs #{shared_path}/#{dir}/#{path} #{release_path}/#{dir}/#{path}" end end end end </code></pre> <p>my deploy/development.rb file:</p> <pre><code>set :deploy_to, "/var/www/#{application}" set :branch, "master" unset :rails_env set :rails_env, "development" </code></pre> <p>UPDATE/ANSWER:</p> <p>Issue was with the current_path variable. Weird since I've tried using</p> <p>set :current_path, "development"</p> <p>and</p> <p>set :current_path, "#{application}/development"</p> <p>and it didn't work. Looks like I have to set the entire path, which seems weird since I've used the latter before.</p> <pre><code>set :current_path, "/var/www/#{application}/development" </code></pre> <p>Anyone know why?</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload