-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
restructure, dynamic options parser for all transfer types
- Loading branch information
Jens Nazarenus
committed
Jan 11, 2014
1 parent
48d1cd7
commit 8a25dca
Showing
13 changed files
with
158 additions
and
65 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
require 'travis-custom-deploy/deployment' | ||
require 'travis-custom-deploy/transfer' | ||
require 'travis-custom-deploy/version' | ||
require 'travis-custom-deploy/services' | ||
require 'travis-custom-deploy/options' | ||
require 'travis-custom-deploy/transfer/base' |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
module TravisCustomDeploy | ||
|
||
# The available services. Each service has an | ||
# unique id and an array of files or directories to deploy. | ||
SERVICES = { | ||
|
||
# Jekyll support | ||
# Usage: service:jekyll | ||
'jekyll' => [ '_site/' ] | ||
} | ||
|
||
# The possible options of the different transfer types | ||
OPTIONS = { | ||
|
||
'sftp' => [ | ||
'host', # host name of the sftp server | ||
'username', # username to connect | ||
'password', # password to connect | ||
'remotedir' # remote dir, for example: /public/ | ||
], | ||
|
||
'ftp' => [ | ||
'host', # host name of the ftp server | ||
'username', # username to connect | ||
'password', # password to connect | ||
'remotedir' # remote dir, for example: /public/ | ||
], | ||
|
||
'copy' => [ | ||
'remotedir' # the destination where to copy the files | ||
] | ||
|
||
} | ||
|
||
class Options | ||
|
||
def self.get_options(transfer_type) | ||
OPTIONS.each do |k,v| | ||
if k == transfer_type | ||
return v | ||
end | ||
end | ||
nil | ||
end | ||
end | ||
end |
This file was deleted.
Oops, something went wrong.
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
module TravisCustomDeploy | ||
|
||
module Transfer | ||
|
||
class Copy < Base | ||
|
||
def initialize | ||
super(@remoteopts, files) | ||
end | ||
end | ||
end | ||
end |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
module TravisCustomDeploy | ||
|
||
module Transfer | ||
|
||
# The class which transfers files via the File Transfer protocol (FTP). | ||
class Ftp < Base | ||
|
||
def initialize(remoteopts, files) | ||
super(remoteopts, files) | ||
end | ||
|
||
def transfer | ||
|
||
end | ||
end | ||
end | ||
end |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
module TravisCustomDeploy | ||
|
||
VERSION = "0.0.1" | ||
VERSION = "0.0.2" | ||
|
||
end |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
require 'helper' | ||
|
||
class TestOptions < Test::Unit::TestCase | ||
|
||
context "Options" do | ||
|
||
context "environment variables" do | ||
setup do | ||
@env = Options.get_options('sftp') | ||
end | ||
|
||
should "return sftp options" do | ||
assert_equal ['host', 'username', 'password', 'remotedir'], @env | ||
end | ||
end | ||
end | ||
end |