homepage/Rakefile

27 lines
690 B
Ruby
Raw Normal View History

2012-06-22 18:08:09 +00:00
ssh_user = "joerg@higgsboson.tk"
ssh_port = "22"
document_root = "/var/www/home/"
rsync_delete= true
public_dir = "build"
source_dir = "source"
desc "Generate jekyll site"
task :generate do
system "middleman build"
end
desc "Deploy website via rsync"
2012-06-23 06:30:52 +00:00
task :deploy do
2012-06-22 18:08:09 +00:00
exclude = ""
if File.exists?('./rsync-exclude')
exclude = "--exclude-from '#{File.expand_path('./rsync-exclude')}'"
end
puts "## Deploying website via Rsync"
ok_failed system("rsync -avze 'ssh -p #{ssh_port}' #{exclude} #{"--delete" unless rsync_delete == false} #{public_dir}/ #{ssh_user}:#{document_root}")
end
desc "Generate website and deploy"
task :gen_deploy => [:generate, :deploy] do
end