Browse Source

Added an app concept to tye.yaml

- tye.yaml already has a name idea, when your applcation is split across multiple tye.yaml files, then the app groups them.
- The name field will be used to produce packages that encapsulate all services defined in a specific tye.yaml.
pull/245/head
David Fowler 6 years ago
parent
commit
d5f5be201a
  1. 3
      samples/multi-yaml/be/tye.yaml
  2. 3
      samples/multi-yaml/fe/tye.yaml
  3. 3
      src/Microsoft.Tye.Core/ApplicationBuilder.cs
  4. 1
      src/Microsoft.Tye.Core/ApplicationFactory.cs
  5. 3
      src/Microsoft.Tye.Core/ConfigModel/ConfigApplication.cs

3
samples/multi-yaml/be/tye.yaml

@ -1,4 +1,5 @@
name: multi-tye
app: multi-tye # name of the bigger application
name: backend # name of this application
services:
- name: backend
project: backend/backend.csproj

3
samples/multi-yaml/fe/tye.yaml

@ -1,4 +1,5 @@
name: multi-tye
app: multi-tye # name of the bigger application
name: frontend # name of this application
services:
- name: frontend
project: frontend/frontend.csproj

3
src/Microsoft.Tye.Core/ApplicationBuilder.cs

@ -13,12 +13,15 @@ namespace Microsoft.Tye
{
Source = source;
Name = name;
Application = name;
}
public FileInfo Source { get; set; }
public string Name { get; set; }
public string? Application { get; set; }
public ContainerRegistry? Registry { get; set; }
public List<ServiceBuilder> Services { get; } = new List<ServiceBuilder>();

1
src/Microsoft.Tye.Core/ApplicationFactory.cs

@ -26,6 +26,7 @@ namespace Microsoft.Tye
var rootConfig = ConfigFactory.FromFile(source);
ValidateConfigApplication(rootConfig);
var root = new ApplicationBuilder(source, rootConfig.Name ?? source.Directory.Name.ToLowerInvariant());
root.Application ??= rootConfig.Application;
queue.Enqueue(rootConfig);

3
src/Microsoft.Tye.Core/ConfigModel/ConfigApplication.cs

@ -21,6 +21,9 @@ namespace Microsoft.Tye.ConfigModel
public string? Name { get; set; }
[YamlMember(Alias = "app")]
public string? Application { get; set; }
public string? Registry { get; set; }
public List<ConfigService> Services { get; set; } = new List<ConfigService>();

Loading…
Cancel
Save