Make username optional for sftp deployment. Like rsync.
This commit is contained in:
parent
cbead1ee4b
commit
2f8d236ee4
1 changed files with 3 additions and 6 deletions
|
@ -111,18 +111,14 @@ EOF
|
||||||
end
|
end
|
||||||
|
|
||||||
case options.method
|
case options.method
|
||||||
when :rsync
|
when :rsync, :sftp
|
||||||
if (!options.host || !options.path)
|
if (!options.host || !options.path)
|
||||||
print_usage_and_die "The rsync deploy method requires host and path to be set."
|
print_usage_and_die "The #{options.method} method requires host and path to be set."
|
||||||
end
|
end
|
||||||
when :ftp
|
when :ftp
|
||||||
if (!options.host || !options.user || !options.password || !options.path)
|
if (!options.host || !options.user || !options.password || !options.path)
|
||||||
print_usage_and_die "The ftp deploy method requires host, user, password, and path to be set."
|
print_usage_and_die "The ftp deploy method requires host, user, password, and path to be set."
|
||||||
end
|
end
|
||||||
when :sftp
|
|
||||||
if (!options.host || !options.user || !options.path)
|
|
||||||
print_usage_and_die "The sftp deploy method requires host, user and path to be set."
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
options
|
options
|
||||||
|
@ -253,6 +249,7 @@ EOF
|
||||||
|
|
||||||
puts "## Deploying via sftp to #{user}@#{host}:#{path}"
|
puts "## Deploying via sftp to #{user}@#{host}:#{path}"
|
||||||
|
|
||||||
|
# `nil` is a valid value for user and/or pass.
|
||||||
Net::SFTP.start(host, user, :password => pass) do |sftp|
|
Net::SFTP.start(host, user, :password => pass) do |sftp|
|
||||||
sftp.mkdir(path)
|
sftp.mkdir(path)
|
||||||
Dir.chdir(self.inst.build_dir) do
|
Dir.chdir(self.inst.build_dir) do
|
||||||
|
|
Loading…
Reference in a new issue