Skip to content

Instantly share code, notes, and snippets.

@andikan
Forked from scottwb/Rakefile
Created July 18, 2013 09:49
Show Gist options
  • Save andikan/6028117 to your computer and use it in GitHub Desktop.
Save andikan/6028117 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