Skip to content
Fetching contributors…
Cannot retrieve contributors at this time
34 lines (26 sloc) 567 Bytes
require 'blimpy/livery/base'
module Blimpy
module Livery
class CWD < Base
def script
'bootstrap.sh'
end
def preflight(box)
box.scp_file(bootstrap_script, dir_name)
end
def use_sudo?(box)
box.username != 'root'
end
def flight(box)
run_sudo = 'sudo'
if use_sudo?(box)
run_sudo = ''
end
box.ssh_into("cd #{dir_name} && #{run_sudo} ./#{script}")
end
def bootstrap_script
File.join(livery_root, script)
end
end
end
end
Something went wrong with that request. Please try again.