mirror of
https://github.com/moparisthebest/android.moparisthebest.org
synced 2024-11-16 06:05:00 -05:00
Merge pull request #1081 from MrJoy/rsync_deployment_fixups
Various rsync deployment fixups:
This commit is contained in:
commit
dfe703b11d
13
Rakefile
13
Rakefile
@ -334,6 +334,11 @@ desc "Generate website and deploy"
|
|||||||
task :gen_deploy => [:integrate, :generate, :deploy] do
|
task :gen_deploy => [:integrate, :generate, :deploy] do
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def ensure_trailing_slash(val)
|
||||||
|
val = "#{val}/" unless(val.end_with?('/'))
|
||||||
|
return val
|
||||||
|
end
|
||||||
|
|
||||||
desc "Deploy website via rsync"
|
desc "Deploy website via rsync"
|
||||||
task :rsync do
|
task :rsync do
|
||||||
exclude = ""
|
exclude = ""
|
||||||
@ -341,7 +346,13 @@ task :rsync do
|
|||||||
exclude = "--exclude-from '#{File.expand_path('./rsync-exclude')}'"
|
exclude = "--exclude-from '#{File.expand_path('./rsync-exclude')}'"
|
||||||
end
|
end
|
||||||
puts "## Deploying website via Rsync"
|
puts "## Deploying website via Rsync"
|
||||||
ok_failed system("rsync -avze 'ssh -p #{configuration[:ssh_port]} #{'-i' + configuration[:ssh_key] unless configuration[:ssh_key].empty?}' #{exclude} #{configuration[:rsync_args]} #{"--delete" unless configuration[:rsync_delete] == false} #{configuration[:destination]}/ #{configuration[:ssh_user]}:#{configuration[:document_root]}")
|
ssh_key = if(!configuration[:ssh_key].nil? && !configuration[:ssh_key].empty?)
|
||||||
|
"-i #{ENV['HOME']}/.ssh/#{configuration[:ssh_key]}"
|
||||||
|
else
|
||||||
|
""
|
||||||
|
end
|
||||||
|
document_root = ensure_trailing_slash(configuration[:document_root])
|
||||||
|
ok_failed system("rsync -avze 'ssh -p #{configuration[:ssh_port]} #{ssh_key}' #{exclude} #{configuration[:rsync_args]} #{"--delete" unless !configuration[:rsync_delete]} #{ensure_trailing_slash(configuration[:destination])} #{configuration[:ssh_user]}:#{document_root}")
|
||||||
end
|
end
|
||||||
|
|
||||||
desc "deploy public directory to github pages"
|
desc "deploy public directory to github pages"
|
||||||
|
Loading…
Reference in New Issue
Block a user