// rake tasks to sync project hosted on freeonrails
require File.dirname(__FILE__) + "/scp_wrapper"
desc "pushes the app files onto freeonrails"
task :update_freeonrails => :environment do t
scp_wrapper = ScpWrapper.new
scp_wrapper.update_code
scp_wrapper.update_db
scp_wrapper.update_javascript
scp_wrapper.update_css
scp_wrapper.update_tests
# scp_wrapper.images
end
// ha .. moved over to rsync last moment
class ScpWrapper
def update_code
sync "app"
end
def update_db
sync "db/migrate", "db"
end
def update_javascript
sync "public/javascripts", "public"
end
def update_css
sync "public/stylesheets", "public"
end
def update_tests
sync "test"
end
def images
sync "public/images", "public"
end
private
def sync(source, dest = "")
system "rsync -avz #{RAILS_ROOT}/#{source} biketw@biketowork.info:/home/biketw/btw/#{dest}"
puts "#{source} synched"
endend
0 Comments:
Post a Comment