lib/commands/container.rb in testlab-1.1.0 vs lib/commands/container.rb in testlab-1.2.0

- old
+ new

@@ -97,45 +97,31 @@ container.console end end - # CONTAINER RECYCLE - #################### - c.desc 'Recycle containers' - c.long_desc <<-EOF -Recycles a container. The container is taken through a series of state changes to ensure it is pristine. + # CONTAINER EPHEMERAL + ###################### + c.desc 'Enable ephemeral mode for containers' + c.long_desc 'Put the container into a ephemeral clone state.' -The container is cycled in this order: - -Deprovision -> Down -> Destroy -> Create -> Up -> Provision -EOF - c.command :recycle do |recycle| - recycle.action do |global_options, options, args| + c.command :ephemeral do |ephemeral| + ephemeral.action do |global_options, options, args| iterate_objects_by_name(options[:name], TestLab::Container) do |container| - container.deprovision - container.down - container.destroy - - container.create - container.up - container.provision + container.ephemeral end end end - # CONTAINER CLONE - ################## - c.desc 'Clone containers' - c.long_desc <<-EOF -An ephemeral copy of the container is started. + # CONTAINER PERSISTENT + ####################### + c.desc 'Enable persistent mode for containers' + c.long_desc 'Put the container into a persistent state.' -NOTE: There is a small delay incured during the first clone operation. -EOF - c.command :clone do |clone| - clone.action do |global_options, options, args| + c.command :persistent do |persistent| + persistent.action do |global_options, options, args| iterate_objects_by_name(options[:name], TestLab::Container) do |container| - container.clone + container.persistent end end end # CONTAINER COPY