Class: Shuttle::Ruby

Inherits:
Strategy show all
Includes:
Support::Bundler, Support::Thin
Defined in:
lib/shuttle/deployment/ruby.rb

Constant Summary

Constants included from Helpers

Helpers::LEVEL_COLORS

Instance Attribute Summary

Attributes inherited from Deploy

#config, #environment, #ssh, #target, #version

Instance Method Summary collapse

Methods included from Support::Thin

#thin_config, #thin_env, #thin_host, #thin_options, #thin_port, #thin_restart, #thin_servers, #thin_start, #thin_stop

Methods included from Support::Bundler

#bundle_install, #bundle_path, #bundler_installed?, #bundler_version, #install_bundler

Methods inherited from Strategy

#changes_at?, #checkout_code, #cleanup_release, #cleanup_releases, #connect, #debug?, #deploy_running?, #disable_history, #execute_commands, #execute_hook, #export_environment, #keep_releases, #link_release, #release_lock, #rollback, #update_code, #update_code_svn, #write_lock, #write_release, #write_revision

Methods inherited from Deploy

#available_releases, #initialize, #last_version

Methods included from PathHelpers

#current_path, #deploy_path, #release_path, #scm_path, #shared_path, #version_path

Methods included from Helpers

#deployer_hostname, #error, #git_installed?, #git_remote, #log, #release_exists?, #stream_output, #svn_installed?, #warn

Constructor Details

This class inherits a constructor from Shuttle::Deploy

Instance Method Details

#deployObject



18
19
20
21
22
23
24
25
26
# File 'lib/shuttle/deployment/ruby.rb', line 18

def deploy
  setup
  update_code
  checkout_code
  bundle_install
  thin_restart
  link_shared_paths
  link_release
end


28
29
30
31
32
# File 'lib/shuttle/deployment/ruby.rb', line 28

def link_shared_paths
  ssh.run("mkdir -p #{release_path('tmp')}")
  ssh.run("ln -s #{shared_path('pids')} #{release_path('tmp/pids')}")
  ssh.run("ln -s #{shared_path('log')} #{release_path('log')}")
end

#setupObject



6
7
8
9
10
11
12
13
14
15
16
# File 'lib/shuttle/deployment/ruby.rb', line 6

def setup
  unless ruby_installed?
    error "Please install Ruby first"
  end
  
  unless bundle_installed?
    install_bundler 
  end

  super
end