ruby-on-railsnginxcapistrano3pumafigaro-ruby

Copy Figaro's application.yml with Capistrano Deploy - Rails


I am trying to deploy my Rails application to a staging server with Capistrano, nginx and Puma. I am using the Figaro gem to setting ENV variables. When deploying, the standard Capistrano configuration does not look for and copy the application.yml file before deploying the app, and of course the deployment fails because of missing credentials. I have found a few Gists with a snippet to insert into the deploy.rb. These looked promising but I was insure about the before/after actions because the ones they were using, didn't match up with the actions used in my deploy.rb file. I also tried the capistrano-figaro-yml gem which seamed to copy the file but would not update the file if it was changed locally.

Is there a more standard way to trigger a copy of the application.yml file with the Capistrano deployment? Thanks


Solution

  • Adding set :linked_files, %w{config/application.yml} to deploy.rb got it going.