Module: Inploy::Templates::Locaweb
- Defined in:
- lib/inploy/templates/locaweb.rb
Class Method Summary collapse
Instance Method Summary collapse
- #local_setup ⇒ Object
- #local_update ⇒ Object
- #path ⇒ Object
- #remote_setup ⇒ Object
- #remote_update ⇒ Object
Class Method Details
.extended(base) ⇒ Object
4 5 6 |
# File 'lib/inploy/templates/locaweb.rb', line 4 def self.extended(base) base.path = nil end |
Instance Method Details
#local_setup ⇒ Object
17 18 19 20 |
# File 'lib/inploy/templates/locaweb.rb', line 17 def local_setup super run "ln -s #{application_path}/public /home/#{user}/public_html/#{application}" end |
#local_update ⇒ Object
22 23 24 |
# File 'lib/inploy/templates/locaweb.rb', line 22 def local_update after_update_code end |
#path ⇒ Object
26 27 28 |
# File 'lib/inploy/templates/locaweb.rb', line 26 def path @path ||= "/home/#{user}/rails_app" end |
#remote_setup ⇒ Object
8 9 10 |
# File 'lib/inploy/templates/locaweb.rb', line 8 def remote_setup run "rm -Rf #{tmp_path} && git clone . #{tmp_path} && tar czf - #{tmp_path} | ssh #{user}@#{host} 'tar xzfv - -C ~/ && mv ~#{tmp_path} #{path}/ && cd #{application_path} && rake inploy:local:setup RAILS_ENV=#{environment} environment=#{environment}'" end |
#remote_update ⇒ Object
12 13 14 15 |
# File 'lib/inploy/templates/locaweb.rb', line 12 def remote_update run "git push ssh://[#{user}@#{host}#{port ? ":#{port}" : ''}]#{application_path} #{branch}" remote_run "cd #{application_path} && git checkout -f && rake inploy:local:update RAILS_ENV=#{environment} environment=#{environment}" end |