My first RubyGem capistrano-erb-uploader 0.1 released
Hey everyone! Yesterday, I released my first public RubyGem.
It's a small utility to use along with Capistrano. Nothing fancy, but my first. :)
History
I was impatient to hard code different env values in configuration files like NginX, Monit conf. Specially things like application path and so on.
So I wrote a small snippet to make them dynamic. But copying it in every project was another pain. The birth of Capistrano ERB Uploader.
Installation
Add this line to your application's Gemfile:
1 | gem 'capistrano-erb-uplader' |
And then execute:
1 | $ bundle |
Or install it yourself as:
1 | $ gem install capistrano-erb-uplader |
Then add this line in your Capfile
1 | require 'capistrano/erb-uploader' |
Usage
You can list a bunch of ERB templates to parse and upload in your deploy.rb file.
1 | set :erb_files, fetch(:erb_files, []).push('config/nginx.conf.erb', 'config/app.monit.erb') |
You might also use this on your own task:
1 2 3 4 5 6 7 8 9 | namespace :some do desc 'Some task to upload specialised erb files' task :task do on rolse(:app) upload_erb 'config/deploy/templates/some.conf.erb', 'config/some.conf' execute :sudo, 'service some restart' end end end |
Any suggestion to improve is most welcome. You can find the source at GitHub - Capistrano ERB Uploader.
Comments
Leave a Comment