Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to copy a file to capistrano shared folder

I have file config/secrets.yml which has to be in my remote server in the shared folder. And it is not in my git repo, so it's not updated as other regular files.

I don't know how generate file the first time.

What I have done till the moment is to create a symlink each time I deploy with

run "ln -nfs #{shared_path}/config/secrets.yml #{release_path}/config/secrets.yml"

which will "update" file in each deploy, but the first time? how to generate secret.yml the first time?

like image 458
sites Avatar asked Jun 03 '13 01:06

sites


1 Answers

You have to add to your .gitignore file:

/config/secrets.yml

the cap task:

task :symlink_config, roles: :app do
  run "ln -nfs #{shared_path}/config/database.yml #{release_path}/config/database.yml"
  run "ln -nfs #{shared_path}/config/secrets.yml #{release_path}/config/secrets.yml"
end
after "deploy:finalize_update", "deploy:symlink_config"

The .yml file in the shared folder I usually create it myself.

like image 134
Ghar Avatar answered Sep 28 '22 10:09

Ghar