Class: Dash::Cli::Prune
Constant Summary
Constants inherited from Base
Base::AUTOMATIC_DEPLOY_LOCK_MESSAGE, Base::HOOK_MUTEX, Base::VERBOSITY
Instance Method Summary collapse
Methods inherited from Base
dynamic_command_class, exit_on_failure?, #initialize
Constructor Details
This class inherits a constructor from Dash::Cli::Base
Instance Method Details
#all ⇒ Object
3 4 5 6 7 8 |
# File 'lib/dash/cli/prune.rb', line 3 def all modify(lock: true, server_lock: true) do containers images end end |
#containers ⇒ Object
23 24 25 26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/dash/cli/prune.rb', line 23 def containers retain = .fetch(:retain, DASH.config.retain_containers) raise "retain must be at least 1" if retain < 1 modify(lock: true, server_lock: true) do on(DASH.hosts) do |host| execute *DASH.auditor.record("Pruned containers"), verbosity: :debug DASH.roles_on(host).each do |role| execute *DASH.prune.app_containers(retain: retain, role: role) end end end end |
#images ⇒ Object
11 12 13 14 15 16 17 18 19 |
# File 'lib/dash/cli/prune.rb', line 11 def images modify(lock: true, server_lock: true) do on(DASH.hosts) do execute *DASH.auditor.record("Pruned images"), verbosity: :debug execute *DASH.prune.dangling_images execute *DASH.prune.tagged_images end end end |