diff options
author | elijah <elijah@riseup.net> | 2013-12-05 16:26:36 -0800 |
---|---|---|
committer | elijah <elijah@riseup.net> | 2013-12-05 16:26:36 -0800 |
commit | 3e7c500dda3a1998a892a9ee06dabf5a2fa70f38 (patch) | |
tree | 8a810abcf30c90d08403f334c36dbc8b8c59e7a6 /lib/leap_cli/remote | |
parent | 4199766b4da7edf170895600ce8eeb8970800769 (diff) |
added no-deploy check and simple `leap test run`.
Diffstat (limited to 'lib/leap_cli/remote')
-rw-r--r-- | lib/leap_cli/remote/leap_plugin.rb | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/lib/leap_cli/remote/leap_plugin.rb b/lib/leap_cli/remote/leap_plugin.rb index 04b1e2c..a284712 100644 --- a/lib/leap_cli/remote/leap_plugin.rb +++ b/lib/leap_cli/remote/leap_plugin.rb @@ -21,6 +21,9 @@ module LeapCli; module Remote; module LeapPlugin run dirs.collect{|dir| "mkdir -m 700 -p #{dir}; "}.join end + # + # echos "ok" if the node has been initialized and the required packages are installed, bails out otherwise. + # def assert_initialized begin test_initialized_file = "test -f #{INITIALIZED_FILE}" @@ -35,6 +38,24 @@ module LeapCli; module Remote; module LeapPlugin end end + # + # bails out the deploy if the file /etc/leap/no-deploy exists. + # This kind of sucks, because it would be better to skip over nodes that have no-deploy set instead + # halting the entire deploy. As far as I know, with capistrano, there is no way to close one of the + # ssh connections in the pool and make sure it gets no further commands. + # + def check_for_no_deploy + begin + run "test ! -f /etc/leap/no-deploy" + rescue Capistrano::CommandError => exc + LeapCli::Util.bail! do + exc.hosts.each do |host| + LeapCli::Util.log "Can't continue because file /etc/leap/no-deploy exists", :host => host + end + end + end + end + def mark_initialized run "touch #{INITIALIZED_FILE}" end |