Created
February 16, 2010 17:39
-
-
Save seth/305721 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
desc "deploy it call with [true/false] to actually deploy" | |
task :deploy, [:doit] do |t, args| | |
args.with_defaults(:doit => false) | |
site_config = YAML.load_file("./config.yaml") | |
output_dir = site_config["output_dir"].sub(/\/$/, "") | |
config = YAML.load_file("./deploy.yaml") | |
user = config["user"] | |
host = config["host"] | |
root = config["root"] | |
dry = args.doit ? "" : "--dry-run" | |
cmd = "rsync -av #{dry} #{output_dir}/ #{user}@#{host}:#{root}" | |
system "#{cmd}" | |
msg = args.doit ? "sync complete" : "DRY RUN finished, rerun with doit=true" | |
puts msg | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment