Browse Source
Print error if there are no runnable services in the application. (#193)
pull/209/head
David Fowler
7 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with
18 additions and
0 deletions
-
src/tye/BuildHost.cs
-
src/tye/Program.DeployCommand.cs
-
src/tye/Program.RunCommand.cs
|
|
|
@ -15,6 +15,12 @@ namespace Microsoft.Tye |
|
|
|
{ |
|
|
|
var output = new OutputContext(console, verbosity); |
|
|
|
var application = await ApplicationFactory.CreateAsync(output, path); |
|
|
|
|
|
|
|
if (application.Services.Count == 0) |
|
|
|
{ |
|
|
|
throw new CommandException($"No services found in \"{application.Source.Name}\""); |
|
|
|
} |
|
|
|
|
|
|
|
await ExecuteBuildAsync(output, application, environment: "production", interactive); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@ -39,6 +39,12 @@ namespace Microsoft.Tye |
|
|
|
|
|
|
|
var output = new OutputContext(console, verbosity); |
|
|
|
var application = await ApplicationFactory.CreateAsync(output, path); |
|
|
|
|
|
|
|
if (application.Services.Count == 0) |
|
|
|
{ |
|
|
|
throw new CommandException($"No services found in \"{application.Source.Name}\""); |
|
|
|
} |
|
|
|
|
|
|
|
await ExecuteDeployAsync(new OutputContext(console, verbosity), application, environment: "production", interactive, force); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
@ -5,6 +5,7 @@ |
|
|
|
using System; |
|
|
|
using System.CommandLine; |
|
|
|
using System.CommandLine.Invocation; |
|
|
|
using System.CommandLine.IO; |
|
|
|
using System.IO; |
|
|
|
using System.Threading; |
|
|
|
using Microsoft.Tye.ConfigModel; |
|
|
|
@ -76,6 +77,11 @@ namespace Microsoft.Tye |
|
|
|
|
|
|
|
InitializeThreadPoolSettings(serviceCount); |
|
|
|
|
|
|
|
if (application.Services.Count == 0) |
|
|
|
{ |
|
|
|
throw new CommandException($"No services found in \"{application.Source.Name}\""); |
|
|
|
} |
|
|
|
|
|
|
|
using var host = new TyeHost(application.ToHostingApplication(), args, debug); |
|
|
|
await host.RunAsync(); |
|
|
|
}); |
|
|
|
|