Skip to content
Browse files

Merge pull request #61 from linjunpop/capistrano-recipe

Capistrano recipe
  • Loading branch information...
2 parents 28bbff1 + 89256f0 commit 054fddae8964acdc726d405cd7207e08cabc3e6f @Sutto committed
Showing with 20 additions and 0 deletions.
  1. +4 −0 README.md
  2. +1 −0 barista.gemspec
  3. +15 −0 lib/barista/capistrano.rb
View
4 README.md
@@ -221,6 +221,10 @@ An excellent example of these hooks in use is [barista\_growl](http://github.com
by Trevor Burnham — a gem perfect for development purposes that automatically shows Growl messages
on compilation.
+## Deployment
+
+Add `require 'barista/capistrano'` to your `deploy.rb`.
+
# Contributors / Credits
The following people have all contributed to Barista:
View
1 barista.gemspec
@@ -28,6 +28,7 @@ Gem::Specification.new do |s|
"Rakefile",
"barista.gemspec",
"lib/barista.rb",
+ "lib/barista/capistrano.rb",
"lib/barista/compiler.rb",
"lib/barista/extensions.rb",
"lib/barista/filter.rb",
View
15 lib/barista/capistrano.rb
@@ -0,0 +1,15 @@
+Capistrano::Configuration.instance.load do
+
+ before 'deploy:restart', 'barista:brew'
+
+ _cset(:barista_role) { :app }
+
+ namespace :barista do
+ desc 'Compile CoffeeScripts.'
+ task :brew, :roles => lambda { fetch(:barista_role) } do
+ rails_env = fetch(:rails_env, "production")
+ run("cd #{current_path} ; RAILS_ENV=#{rails_env} bundle exec rake barista:brew")
+ end
+ end
+end
+

0 comments on commit 054fdda

Please sign in to comment.
Something went wrong with that request. Please try again.