Parse various ERB template based configuration files and upload them with Capistrano.
Add this line to your application's Gemfile:
gem 'capistrano-erb-uploader'
And then execute:
$ bundle
Or install it yourself as:
$ gem install capistrano-erb-uplaader
Then add this line in your Capfile
require 'capistrano/erb-uploader'
You can list a bunch of ERB templates to parse and upload in your deploy.rb
file.
set :erb_files, fetch(:erb_files, []).push('config/nginx.conf.erb', 'config/app.monit.erb')
You might also use this on your own task:
namespace :some do
desc 'Some task to upload specialised erb files'
task :task do
on roles(:app)
upload_erb 'config/deploy/templates/some.conf.erb', 'config/some.conf'
execute :sudo, 'service some restart'
end
end
end
Bug reports and pull requests are welcome on GitHub at https://github.com/albabar/capistrano-erb-uplaader.
The gem is available as open source under the terms of the MIT License.