Where do you put your app-config-files when deploying rails with capistrano and svn

蓝咒 提交于 2019-12-03 08:21:57

You should place your config files in

/path/to/deployed_app/shared

Then in a capistrano task, sym link to those files:

namespace :deploy do
  task :symlink_shared do
    run "ln -s #{shared_path}/database.yml #{release_path}/config/"
  end
end

before "deploy:restart", "deploy:symlink_shared"
Andrew

In Capistrano v3, you can use a task called deploy:symlink:shared.

Provide a list of files you placed in the shared directory, so Capistrano knows which files to symlink when the task is run. This is typically done in deploy.rb:

set :linked_files, %w{
  app/config/database.yml
  app/config/userconfig.yml
}

Related: Capistrano - How to put files in the shared folder?

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!