Class: Pushwagner::Static::Deployer
- Inherits:
-
Object
- Object
- Pushwagner::Static::Deployer
- Defined in:
- lib/pushwagner/static.rb
Instance Attribute Summary collapse
-
#environment ⇒ Object
readonly
Returns the value of attribute environment.
Instance Method Summary collapse
- #deploy ⇒ Object
-
#initialize(environment, opts = {}) ⇒ Deployer
constructor
A new instance of Deployer.
Constructor Details
#initialize(environment, opts = {}) ⇒ Deployer
Returns a new instance of Deployer.
9 10 11 |
# File 'lib/pushwagner/static.rb', line 9 def initialize(environment, opts = {}) @environment = environment end |
Instance Attribute Details
#environment ⇒ Object (readonly)
Returns the value of attribute environment.
7 8 9 |
# File 'lib/pushwagner/static.rb', line 7 def environment @environment end |
Instance Method Details
#deploy ⇒ Object
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/pushwagner/static.rb', line 13 def deploy environment.static.each do |name, files| environment.hosts.each do |host| Net::SCP.start(host, environment.user) do |scp| puts "Uploading files to #{host}:#{environment.path_prefix}/#{name}/" files.each do |f| if File.exists?(f) scp.upload!(f, "#{environment.path_prefix}/#{name}/", :recursive => File.directory?(f)) else puts "Warning: File #{f} does not exist" end end end end end end |