lib/cli/commands/apps.rb in af-0.3.18.3 vs lib/cli/commands/apps.rb in af-0.3.18.4

- old
+ new

@@ -289,18 +289,20 @@ if appname app = client.app_info(appname) if @options[:canary] display "[--canary] is deprecated and will be removed in a future version".yellow end - upload_app_bits(appname, @path) + infra = app[:infra] ? app[:infra][:provider] : nil + upload_app_bits(appname, @path, infra) restart appname if app[:state] == 'STARTED' else each_app do |name| display "Updating application '#{name}'..." app = client.app_info(name) - upload_app_bits(name, @application) + infra = app[:infra] ? app[:infra][:provider] : nil + upload_app_bits(name, @application, infra) restart name if app[:state] == 'STARTED' end end end @@ -418,11 +420,11 @@ def find_sockets(path) files = Dir.glob("#{path}/**/*", File::FNM_DOTMATCH) files && files.select { |f| File.socket? f } end - def upload_app_bits(appname, path) + def upload_app_bits(appname, path, infra) display 'Uploading Application:' upload_file, file = "#{Dir.tmpdir}/#{appname}.zip", nil FileUtils.rm_f(upload_file) @@ -478,11 +480,12 @@ end # Check to see if the resource check is worth the round trip if (total_size > (64*1024)) # 64k for now # Send resource fingerprints to the cloud controller - appcloud_resources = client.check_resources(fingerprints) + # FIXME where do I get infra? + appcloud_resources = client.check_resources(fingerprints,infra) end display 'OK'.green if appcloud_resources display ' Processing resources: ', false @@ -942,11 +945,11 @@ command = info(:command) runtime = info(:runtime) infra = info(:infra) if infra - err "Infra '#{infra}' is not valid" unless VMC::Cli::InfraHelper.valid?(infra) + err "Infra '#{infra}' is not valid" unless client.infra_valid?(infra) end # Check app existing upfront if we have appname app_checked = false if appname @@ -990,11 +993,11 @@ runtime = detect_runtime(default_runtime, !no_prompt) if framework.prompt_for_runtime? end command = ask("Start Command") if !command && framework.require_start_command? default_url = "None" - default_url = "#{appname}.#{VMC::Cli::Config.suggest_url}" if framework.require_url? + default_url = "#{appname}.#{client.suggest_url(infra)}" if framework.require_url? unless no_prompt || url || !framework.require_url? url = ask( "Application Deployed URL", :default => default_url @@ -1058,10 +1061,10 @@ bind_service_banner(name, appname) end end # Stage and upload the app bits. - upload_app_bits(appname, @application) + upload_app_bits(appname, @application, infra) start(appname, true) unless no_start end def do_stats(appname)