Module: CapBlueGreenDeploy::Tasks::Common
- Defined in:
- lib/cap_blue_green_deploy/tasks/common.rb
Instance Method Summary collapse
- #dirs_inside(path) ⇒ Object
- #do_symlink(from, to) ⇒ Object
- #fullpath_by_symlink(sym) ⇒ Object
- #remove_dirs(dirs) ⇒ Object
Instance Method Details
#dirs_inside(path) ⇒ Object
6 7 8 |
# File 'lib/cap_blue_green_deploy/tasks/common.rb', line 6 def dirs_inside path capture("ls -xt #{path}").split.reverse end |
#do_symlink(from, to) ⇒ Object
10 11 12 |
# File 'lib/cap_blue_green_deploy/tasks/common.rb', line 10 def do_symlink from, to run "rm -f #{to} && ln -s #{from} #{to}" end |
#fullpath_by_symlink(sym) ⇒ Object
2 3 4 |
# File 'lib/cap_blue_green_deploy/tasks/common.rb', line 2 def fullpath_by_symlink sym capture("if [ -L #{sym} ]; then readlink #{sym}; fi ").strip end |
#remove_dirs(dirs) ⇒ Object
14 15 16 |
# File 'lib/cap_blue_green_deploy/tasks/common.rb', line 14 def remove_dirs dirs try_sudo "rm -rf #{dirs}" end |