Where do you place your config application files when deploying rails using capistrano and svn

I have two configuration files

/app/config/database.yml 

and

 /app/config/userconfig.yml 

I do not want to put the credentials of the database and userconfig in the svn repository, so I have database.yml.dist and userconfig.yml.dist.

What is the best way to get copies of dist files in a shared directory when you deploy the application for the first time?

For future deployments, I will refer to them from / app / current / config

+6
svn ruby-on-rails deployment configuration-files capistrano
source share
2 answers

You must put your configuration files in

 /path/to/deployed_app/shared 

Then in the capistrano task sym refers to these 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" 
+10
source share

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

Provide a list of the files that you put in the shared directory, so that Capistrano knows which files symbolize when the task starts. This is usually done in deploy.rb :

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

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

+1
source share

All Articles