Supporting port config of SFTP
This commit is contained in:
parent
83c24d7443
commit
08875eebec
4 changed files with 4 additions and 1 deletions
|
@ -102,6 +102,7 @@ Activate the extension by adding the following to `config.rb`:
|
||||||
activate :deploy do |deploy|
|
activate :deploy do |deploy|
|
||||||
deploy.method = :sftp
|
deploy.method = :sftp
|
||||||
deploy.host = "sftp.example.com"
|
deploy.host = "sftp.example.com"
|
||||||
|
deploy.port = 22
|
||||||
deploy.path = "/srv/www/site"
|
deploy.path = "/srv/www/site"
|
||||||
# Optional Settings
|
# Optional Settings
|
||||||
# deploy.user = "tvaughan" # no default
|
# deploy.user = "tvaughan" # no default
|
||||||
|
|
1
USAGE
1
USAGE
|
@ -47,6 +47,7 @@ activate :deploy do |deploy|
|
||||||
deploy.method = :sftp
|
deploy.method = :sftp
|
||||||
# host, user, passwword and path *must* be set
|
# host, user, passwword and path *must* be set
|
||||||
deploy.host = "sftp.example.com"
|
deploy.host = "sftp.example.com"
|
||||||
|
deploy.port = 22
|
||||||
deploy.path = "/srv/www/site"
|
deploy.path = "/srv/www/site"
|
||||||
# user is optional (no default)
|
# user is optional (no default)
|
||||||
deploy.user = "tvaughan"
|
deploy.user = "tvaughan"
|
||||||
|
|
|
@ -15,6 +15,7 @@ module Middleman
|
||||||
@user = self.options.user
|
@user = self.options.user
|
||||||
@pass = self.options.password
|
@pass = self.options.password
|
||||||
@path = self.options.path
|
@path = self.options.path
|
||||||
|
@port = self.options.port
|
||||||
end
|
end
|
||||||
|
|
||||||
def process
|
def process
|
||||||
|
|
|
@ -10,7 +10,7 @@ module Middleman
|
||||||
puts "## Deploying via sftp to #{self.user}@#{self.host}:#{path}"
|
puts "## Deploying via sftp to #{self.user}@#{self.host}:#{path}"
|
||||||
|
|
||||||
# `nil` is a valid value for user and/or pass.
|
# `nil` is a valid value for user and/or pass.
|
||||||
Net::SFTP.start(self.host, self.user, :password => self.pass) do |sftp|
|
Net::SFTP.start(self.host, self.user, :password => self.pass, :port => self.port) do |sftp|
|
||||||
sftp.mkdir(self.path)
|
sftp.mkdir(self.path)
|
||||||
|
|
||||||
Dir.chdir(self.server_instance.build_dir) do
|
Dir.chdir(self.server_instance.build_dir) do
|
||||||
|
|
Loading…
Add table
Reference in a new issue