Created
June 2, 2011 21:17
-
-
Save overbalance/1005360 to your computer and use it in GitHub Desktop.
Middleman Rake Tasks
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rubygems' | |
desc "Completely empty /build" | |
task :clobber do | |
sh "rm -rf build/* build/.[Dh]*" | |
end | |
desc "Export compiled build" | |
task :build do | |
sh "mm-build" | |
end | |
desc "Deply to ftp" | |
task :deploy => [:clobber, :build] do | |
servers = %w{ftp.server.com} | |
servers.each do |server| | |
puts "Deploying app to #{server}" | |
system("cd build;rsync -rltvz --delete-before -e ssh . user@#{server}:/home/your/server/path") | |
# system("ssh root@#{server} chown -R www-data:www-data /var/www/webapp/") | |
# system("ssh root@server /etc/init.d/apache2 reload") | |
end | |
end | |
desc "Tar up the build folder with timestamp" | |
task :zip => [:clobber, :build] do | |
system("tar -czf build"+DateTime::now().strftime("%Y%m%d-%H%M%S")+".tar.gz build/") | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment