-
-
Save andikan/6028117 to your computer and use it in GitHub Desktop.
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
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