diff --git a/src/Microsoft.Tye.Core/PorterManifestGenerator.cs b/src/Microsoft.Tye.Core/PorterManifestGenerator.cs index 1c5bb0c9..1b76db9e 100644 --- a/src/Microsoft.Tye.Core/PorterManifestGenerator.cs +++ b/src/Microsoft.Tye.Core/PorterManifestGenerator.cs @@ -32,6 +32,28 @@ namespace Microsoft.Tye mapping.Add("tag", image.ImageTag); } } + var mixins = new YamlSequenceNode(); + root.Add("mixins", mixins); + mixins.Add("exec"); + + var installSeq = new YamlSequenceNode(); + root.Add("install", installSeq); + var installExec = new YamlMappingNode(); + installSeq.Add(installExec); + var args = new YamlMappingNode(); + installExec.Add("exec", args); + args.Add("command", "ls"); + args.Add("description", "ls"); + + //root.Add("upgrade", ""); + var uninstallSeq = new YamlSequenceNode(); + root.Add("uninstall", uninstallSeq); + var uninstallExec = new YamlMappingNode(); + uninstallSeq.Add(uninstallExec); + var unargs = new YamlMappingNode(); + uninstallExec.Add("exec", unargs); + unargs.Add("command", "ls"); + unargs.Add("description", "ls"); return new YamlDocument(root); } diff --git a/src/Microsoft.Tye.Core/PorterPublisher.cs b/src/Microsoft.Tye.Core/PorterPublisher.cs index e080e8af..ce2a068f 100644 --- a/src/Microsoft.Tye.Core/PorterPublisher.cs +++ b/src/Microsoft.Tye.Core/PorterPublisher.cs @@ -11,16 +11,22 @@ namespace Microsoft.Tye { public static async Task PublishAsync(OutputContext output, YamlDocument document, ApplicationBuilder builder) { - var tempFile = TempFile.Create(); + using var tempFile = TempFile.Create(); { await using var stream = File.OpenWrite(tempFile.FilePath); await using var writer = new StreamWriter(stream, new UTF8Encoding(encoderShouldEmitUTF8Identifier: false), leaveOpen: true); var yamlStream = new YamlStream(document); yamlStream.Save(writer, assignAnchors: false); + } - await ProcessUtil.RunAsync("porter", $"publish -f {tempFile.FilePath}"); + var res = await ProcessUtil.RunAsync("porter", $"publish -f {tempFile.FilePath}", throwOnError: false); + if (res.ExitCode != 0) + { + output.WriteInfoLine(res.StandardError); + output.WriteInfoLine(res.StandardOutput); } + } } }