lib/docker-provider/action.rb in docker-provider-0.0.2 vs lib/docker-provider/action.rb in docker-provider-0.1.0

- old
+ new

@@ -3,12 +3,13 @@ require_relative 'action/create' require_relative 'action/destroy' require_relative 'action/forward_ports' require_relative 'action/stop' require_relative 'action/message' +require_relative 'action/prepare_nfs_valid_ids' +require_relative 'action/prepare_nfs_settings' require_relative 'action/is_running' -require_relative 'action/share_folders' require_relative 'action/start' module VagrantPlugins module DockerProvider module Action @@ -26,18 +27,26 @@ b2.use Builtin::HandleBoxUrl # TODO: Find out where this fits into the process # b2.use Builtin::EnvSet, :port_collision_repair => true # b2.use Builtin::HandleForwardedPortCollisions b2.use Builtin::Provision - b2.use ShareFolders + b2.use PrepareNFSValidIds + b2.use Builtin::SyncedFolderCleanup + b2.use Builtin::SyncedFolders + b2.use PrepareNFSSettings b2.use ForwardPorts # This will actually create and start, but that's fine b2.use Create b2.use action_boot + else + b2.use PrepareNFSValidIds + b2.use Builtin::SyncedFolderCleanup + b2.use Builtin::SyncedFolders + b2.use PrepareNFSSettings + b2.use action_start end end - b.use action_start end end # This action just runs the provisioners on the machine. def self.action_provision @@ -65,12 +74,14 @@ # the virtual machine, gracefully or by force. def self.action_halt Builder.new.tap do |b| b.use Builtin::Call, Created do |env, b2| if env[:result] - # TODO: Make use of this once we figure out how to run dockers in machine mode - # b2.use Builtin::Call, Builtin::GracefulHalt, :stopped, :running do |env2, b3| - b2.use Stop + b2.use Builtin::Call, Builtin::GracefulHalt, :stopped, :running do |env2, b3| + if !env2[:result] + b3.use Stop + end + end else b2.use Message, :not_created end end end