Class: Eclix::Uploader
- Inherits:
-
Object
- Object
- Eclix::Uploader
- Defined in:
- lib/eclix/sync.rb
Instance Method Summary collapse
- #upload(environment) ⇒ Object
- #upload_static(environment) ⇒ Object
- #upload_template(environment) ⇒ Object
Instance Method Details
#upload(environment) ⇒ Object
74 75 76 77 |
# File 'lib/eclix/sync.rb', line 74 def upload(environment) upload_template(environment) upload_static(environment) end |
#upload_static(environment) ⇒ Object
64 65 66 67 68 69 70 71 72 73 |
# File 'lib/eclix/sync.rb', line 64 def upload_static(environment) environment.publications.each do |pub| p 'Syncing statics...' p pub.static(environment.local.publication_dir(pub.name)) => pub.static(environment.remote.publication_dir(pub.name)) Net::SCP.upload!(environment.remote.host, environment.remote.user, pub.static(environment.local.publication_dir(pub.name)), environment.remote.publication_dir(pub.name), :ssh => {:port => environment.remote.port}, :recursive => true) p pub.static(environment.local.publication_dir("shared-war")) => pub.static(environment.remote.publication_dir(pub.name)) Net::SCP.upload!(environment.remote.host, environment.remote.user, pub.static(environment.local.publication_dir("shared-war")), environment.remote.publication_dir(pub.name), :ssh => {:port => environment.remote.port}, :recursive => true) p 'Statics synced.' end end |
#upload_template(environment) ⇒ Object
54 55 56 57 58 59 60 61 62 63 |
# File 'lib/eclix/sync.rb', line 54 def upload_template(environment) environment.publications.each do |pub| p 'Syncing templates...' p pub.template(environment.local.publication_dir(pub.name)) => environment.remote.publication_dir(pub.name) Net::SCP.upload!(environment.remote.host, environment.remote.user, pub.template(environment.local.publication_dir(pub.name)), environment.remote.publication_dir(pub.name), :ssh => {:port => environment.remote.port}, :recursive => true) p pub.template(environment.local.publication_dir("shared-war")) => environment.remote.publication_dir(pub.name) Net::SCP.upload!(environment.remote.host, environment.remote.user, pub.template(environment.local.publication_dir("shared-war")), environment.remote.publication_dir(pub.name), :ssh => {:port => environment.remote.port}, :recursive => true) p 'Templates synced.' end end |