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?
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With