homepage/Rakefile

27 lines
688 B
Ruby
Raw Normal View History

2012-06-22 18:08:09 +00:00
ssh_user = "joerg@higgsboson.tk"
ssh_port = "22"
2013-06-05 16:18:41 +00:00
document_root = "/srv/http/home"
2012-06-22 18:08:09 +00:00
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"
2013-02-20 22:18:23 +00:00
system("rsync -avze 'ssh -p #{ssh_port}' #{exclude} #{"--delete" unless rsync_delete == false} \"#{public_dir}/\" \"#{ssh_user}:#{document_root}\"")
2012-06-22 18:08:09 +00:00
end
desc "Generate website and deploy"
task :gen_deploy => [:generate, :deploy] do
end