Skip to content

Instantly share code, notes, and snippets.

@scottweisman
Forked from scottwb/Rakefile
Created January 10, 2013 05:39
Show Gist options
  • Save scottweisman/4499718 to your computer and use it in GitHub Desktop.
Save scottweisman/4499718 to your computer and use it in GitHub Desktop.
SSH_USER = 'root'
SSH_HOST = 'www.example.com'
SSH_DIR = '/var/www/html/www.example.com'
desc "Build the website from source"
task :build do
puts "## Building website"
status = system("middleman build --clean")
puts status ? "OK" : "FAILED"
end
desc "Run the preview server at http://localhost:4567"
task :preview do
system("middleman server")
end
desc "Deploy website via rsync"
task :deploy do
puts "## Deploying website via rsync to #{SSH_HOST}"
status = system("rsync -avze 'ssh' --delete build/ #{SSH_USER}@#{SSH_HOST}:#{SSH_DIR}")
puts status ? "OK" : "FAILED"
end
desc "Build and deploy website"
task :gen_deploy => [:build, :deploy] do
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment