No release in over 3 years
Low commit activity in last 3 years
Capistrano tasks for automating figaro `application.yml` file handling for Rails 4+ apps. This plugins syncs contents of your local figaro file and copies that to the remote server.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

>= 0

Runtime

>= 1.2.0, ~> 1.2
 Project Readme

Capistrano::FigaroYml

Capistrano tasks for handling figaro application.yml when deploying Rails 4+ apps.

Install

Add this to Gemfile:

group :development do
  gem 'capistrano', '~> 3.3.0'
  gem 'capistrano-figaro-yml', '~> 1.0.2'
end

And then:

$ bundle install

Setup and usage

  • make sure your local config/application.yml is not git tracked. It should be on the disk, but gitignored.

  • populate production figaro settings in local config/application.yml:

      production:
        secret_key_base: "d6ced..."
    
  • add to Capfile:

      require 'capistrano/figaro_yml'
    
  • create figaro application.yml file on the remote server by executing this task:

      $ bundle exec cap production setup
    

You can now proceed with other deployment tasks.

What if a new config is added to figaro file?

  • add it to local config/application.yml:

      production:
        secret_key_base: "d6ced..."
        foobar: "some_other_secret"
    
  • if you're working in a team where other people have the deploy rights, compare you local application.yml with the one on the server. This is to ensure you didn't miss an update.

  • copy to the server:

      $ bundle exec cap production setup
    
  • notify your colleagues that have the deploy rights that the remote application.yml has been updated so they can change their copy.

How it works

When you execute $ bundle exec cap production setup:

  • figaro settings from your local application.yml are copied to the server.
  • only "stage" secrets are copied: if you are deploying to production, only production secrets are copied there
  • on the server secrets file is located in #{shared_path}/config/application.yml

On deployment:

  • secrets file is automatically symlinked to #{current_path}/config/application.yml

Configuration

None.

More Capistrano automation?

Check out capistrano-plugins github org.

License

MIT