tasks/stack/stack.thor in docker-sync-0.4.6 vs tasks/stack/stack.thor in docker-sync-0.5.0.pre.beta1
- old
+ new
@@ -1,8 +1,7 @@
require 'docker-sync'
require 'docker-sync/sync_manager'
-require 'docker-sync/preconditions/strategy'
require 'docker-sync/update_check'
require 'docker-sync/upgrade_check'
require 'docker/compose'
require 'docker-sync/compose'
require 'docker-sync/config/project_config'
@@ -33,19 +32,19 @@
upgrades = UpgradeChecker.new
upgrades.run
begin
config = DockerSync::ProjectConfig.new(config_path: options[:config])
- DockerSync::Preconditions::Strategy.instance.check_all_preconditions(config)
- rescue Exception => e
+ DockerSync::Dependencies.ensure_all!(config)
+ rescue StandardError => e
say_status 'error', e.message, :red
exit(1)
end
- say_status 'note:', 'You can also run docker-sync in the background with docker-sync --daemon'
+ say_status 'note:', 'You can also run docker-sync in the background with docker-sync start'
- @sync_manager = Docker_sync::SyncManager.new(config: config)
+ @sync_manager = DockerSync::SyncManager.new(config: config)
@sync_manager.run(options[:sync_name])
global_options = @sync_manager.global_options
@compose_manager = ComposeManager.new(global_options)
compose_thread = Thread.new {
@@ -58,11 +57,11 @@
rescue SystemExit, Interrupt
say_status 'shutdown', 'Shutting down...', :blue
@sync_manager.stop
@compose_manager.stop
- rescue Exception => e
+ rescue StandardError => e
puts "EXCEPTION: #{e.inspect}"
puts "MESSAGE: #{e.message}"
end
end
@@ -74,16 +73,16 @@
exit(0)
end
begin
config = DockerSync::ProjectConfig.new(config_path: options[:config])
- DockerSync::Preconditions::Strategy.instance.check_all_preconditions(config)
- rescue Exception => e
+ DockerSync::Dependencies.ensure_all!(config)
+ rescue StandardError => e
say_status 'error', e.message, :red
exit(1)
end
- @sync_manager = Docker_sync::SyncManager.new(config: config)
+ @sync_manager = DockerSync::SyncManager.new(config: config)
global_options = @sync_manager.global_options
# shutdown compose first
@compose_manager = ComposeManager.new(global_options)
@compose_manager.clean
say_status 'success', 'Finished cleaning up your app stack', :green