0

我的 capistrano resipe 尝试从发布目录中提取 databse.yml 而不是

/var/www/pantry/current/config/database.yml

并崩溃并出现以下错误:

No such file or directory - /var/www/pantry/releases/20130610020222/config/database.yml

我的部署.rb

require "rvm/capistrano"
require "bundler/capistrano"
set :application, "pantry"
set :repository,  "git@github.com:tbrooke/food-pantry-manager.git"
set :user, 'deployer'
set :ssh_options, {:forward_agent => true}
set :use_sudo, false
set :rvm_type, :user
default_run_options[:pty] = true
set :scm, :git

set :deploy_to, "/var/www/pantry"
set :branch, "master"
set :deploy_via, :remote_cache
set :use_sudo, false

server "192.168.1.30", :web, :app, :db, primary: true

ssh_options[:forward_agent] = true

role :web,    "192.168.1.30"
role :app,    "192.168.1.30"
role :db,     "192.168.1.30", :primary => true

after "deploy", "deploy:migrate"

after 'deploy:update_code', 'deploy:symlink_db'

namespace  :deploy do
   desc "Symlinks the database.yml"
   task :symlink_db, :roles => :app do
   run "ln -nfs #{shared_path}config/database.yml #{release_path}/config/database.yml"
   end
end

require 'simple-capistrano-unicorn'
after :deploy, "unicorn:restart"

如何将其更改为指向当前目录?

4

1 回答 1

0

代替

#{release_path}/config/database.yml

利用

#{current_path}/config/database.yml
于 2013-06-10T21:48:31.677 回答