From 2da5042bc58c426df563f276193542044df56270 Mon Sep 17 00:00:00 2001 From: slewis74 Date: Tue, 9 Mar 2021 09:54:03 +1000 Subject: [PATCH 1/7] new logging infra --- source/Calamari/Calamari.csproj | 2 +- .../AzureWebAppServiceMessageHandlerFixture.cs | 5 ++--- source/Sashimi/AzureActionHandlerExtensions.cs | 7 ++++--- source/Sashimi/AzureWebAppActionHandler.cs | 5 +++-- source/Sashimi/AzureWebAppHealthCheckActionHandler.cs | 9 +++++---- source/Sashimi/AzureWebAppPackageContributor.cs | 3 ++- source/Sashimi/AzureWebAppServiceMessageHandler.cs | 4 ++-- source/Sashimi/Sashimi.csproj | 1 + 8 files changed, 20 insertions(+), 16 deletions(-) diff --git a/source/Calamari/Calamari.csproj b/source/Calamari/Calamari.csproj index e65d0f6..b561358 100644 --- a/source/Calamari/Calamari.csproj +++ b/source/Calamari/Calamari.csproj @@ -9,7 +9,7 @@ - + diff --git a/source/Sashimi.Tests/AzureWebAppServiceMessageHandlerFixture.cs b/source/Sashimi.Tests/AzureWebAppServiceMessageHandlerFixture.cs index 576da23..6ea22ea 100644 --- a/source/Sashimi.Tests/AzureWebAppServiceMessageHandlerFixture.cs +++ b/source/Sashimi.Tests/AzureWebAppServiceMessageHandlerFixture.cs @@ -10,7 +10,6 @@ using Sashimi.Server.Contracts; using Sashimi.Server.Contracts.Endpoints; using Sashimi.Server.Contracts.ServiceMessages; -using YamlDotNet.Core; using AzureWebAppServiceMessageNames = Sashimi.AzureWebApp.AzureWebAppServiceMessageHandler.AzureWebAppServiceMessageNames; namespace Sashimi.AzureWebApp.Tests @@ -18,12 +17,12 @@ namespace Sashimi.AzureWebApp.Tests public class AzureWebAppServiceMessageHandlerFixture { ICreateTargetServiceMessageHandler serviceMessageHandler; - ILog logger; + ISystemLog logger; [SetUp] public void SetUp() { - logger = Substitute.For(); + logger = Substitute.For(); serviceMessageHandler = new AzureWebAppServiceMessageHandler(logger); } diff --git a/source/Sashimi/AzureActionHandlerExtensions.cs b/source/Sashimi/AzureActionHandlerExtensions.cs index 65dd23f..a8dc6fd 100644 --- a/source/Sashimi/AzureActionHandlerExtensions.cs +++ b/source/Sashimi/AzureActionHandlerExtensions.cs @@ -1,4 +1,5 @@ using System; +using Octopus.Server.Extensibility.HostServices.Diagnostics; using Sashimi.Azure.Accounts; using Sashimi.Server.Contracts.ActionHandlers; using Sashimi.Server.Contracts.CommandBuilders; @@ -7,12 +8,12 @@ namespace Sashimi.AzureWebApp { static class AzureActionHandlerExtensions { - - public static ICalamariCommandBuilder WithCheckAccountIsNotManagementCertificate(this ICalamariCommandBuilder builder, IActionHandlerContext context) + + public static ICalamariCommandBuilder WithCheckAccountIsNotManagementCertificate(this ICalamariCommandBuilder builder, IActionHandlerContext context, ITaskLog taskLog) { if (context.Variables.Get(SpecialVariables.AccountType) != AccountTypes.AzureServicePrincipalAccountType.ToString()) { - context.Log.Warn("Azure have announced they will be retiring Service Management API support on June 30th 2018. Please switch to using Service Principals for your Octopus Azure accounts https://g.octopushq.com/AzureServicePrincipalAccount"); + taskLog.Warn("Azure have announced they will be retiring Service Management API support on June 30th 2018. Please switch to using Service Principals for your Octopus Azure accounts https://g.octopushq.com/AzureServicePrincipalAccount"); } return builder; diff --git a/source/Sashimi/AzureWebAppActionHandler.cs b/source/Sashimi/AzureWebAppActionHandler.cs index 12ff10f..293f081 100644 --- a/source/Sashimi/AzureWebAppActionHandler.cs +++ b/source/Sashimi/AzureWebAppActionHandler.cs @@ -1,5 +1,6 @@ using System; using Octopus.CoreUtilities; +using Octopus.Server.Extensibility.HostServices.Diagnostics; using Sashimi.AzureScripting; using Sashimi.AzureWebApp.Endpoints; using Sashimi.Server.Contracts.ActionHandlers; @@ -18,7 +19,7 @@ class AzureWebAppActionHandler : IActionHandlerWithAccount public ActionHandlerCategory[] Categories => new[] { ActionHandlerCategory.BuiltInStep, AzureConstants.AzureActionHandlerCategory, ActionHandlerCategory.Package }; public string[] StepBasedVariableNameForAccountIds { get; } = {SpecialVariables.Action.Azure.AccountId}; - public IActionHandlerResult Execute(IActionHandlerContext context) + public IActionHandlerResult Execute(IActionHandlerContext context, ITaskLog taskLog) { var isLegacyAction = !string.IsNullOrWhiteSpace(context.Variables.Get(SpecialVariables.Action.Azure.AccountId)); @@ -32,7 +33,7 @@ public IActionHandlerResult Execute(IActionHandlerContext context) .WithCheckAccountIsNotManagementCertificate(context) .WithAzureTools(context) .WithStagedPackageArgument() - .Execute(); + .Execute(taskLog); } } } \ No newline at end of file diff --git a/source/Sashimi/AzureWebAppHealthCheckActionHandler.cs b/source/Sashimi/AzureWebAppHealthCheckActionHandler.cs index 4a93453..7b62e87 100644 --- a/source/Sashimi/AzureWebAppHealthCheckActionHandler.cs +++ b/source/Sashimi/AzureWebAppHealthCheckActionHandler.cs @@ -1,4 +1,5 @@ -using Sashimi.Server.Contracts.ActionHandlers; +using Octopus.Server.Extensibility.HostServices.Diagnostics; +using Sashimi.Server.Contracts.ActionHandlers; using Sashimi.Server.Contracts.Calamari; namespace Sashimi.AzureWebApp @@ -17,11 +18,11 @@ class AzureWebAppHealthCheckActionHandler : IActionHandlerWithAccount public ActionHandlerCategory[] Categories => new[] { ActionHandlerCategory.BuiltInStep, ActionHandlerCategory.Azure }; public string[] StepBasedVariableNameForAccountIds { get; } = {SpecialVariables.Action.Azure.AccountId}; - public IActionHandlerResult Execute(IActionHandlerContext context) + public IActionHandlerResult Execute(IActionHandlerContext context, ITaskLog taskLog) { return context.CalamariCommand(CalamariAzure, "health-check") - .WithCheckAccountIsNotManagementCertificate(context) - .Execute(); + .WithCheckAccountIsNotManagementCertificate(context, taskLog) + .Execute(taskLog); } } } \ No newline at end of file diff --git a/source/Sashimi/AzureWebAppPackageContributor.cs b/source/Sashimi/AzureWebAppPackageContributor.cs index ece738f..a975e71 100644 --- a/source/Sashimi/AzureWebAppPackageContributor.cs +++ b/source/Sashimi/AzureWebAppPackageContributor.cs @@ -1,4 +1,5 @@ using System; +using Octopus.Server.Extensibility.HostServices.Diagnostics; using Sashimi.AzureWebApp.Endpoints; using Sashimi.Server.Contracts; using Sashimi.Server.Contracts.ActionHandlers; @@ -7,7 +8,7 @@ namespace Sashimi.AzureWebApp { class AzureWebAppPackageContributor : IContributeToPackageDeployment { - public PackageContributionResult Contribute(DeploymentTargetType deploymentTargetType, IActionHandlerContext context) + public PackageContributionResult Contribute(DeploymentTargetType deploymentTargetType, IActionHandlerContext context, ITaskLog taskLog) { return deploymentTargetType == AzureWebAppEndpoint.AzureWebAppDeploymentTargetType ? PackageContributionResult.RedirectToHandler() diff --git a/source/Sashimi/AzureWebAppServiceMessageHandler.cs b/source/Sashimi/AzureWebAppServiceMessageHandler.cs index b3df42d..33b2f18 100644 --- a/source/Sashimi/AzureWebAppServiceMessageHandler.cs +++ b/source/Sashimi/AzureWebAppServiceMessageHandler.cs @@ -13,9 +13,9 @@ namespace Sashimi.AzureWebApp { class AzureWebAppServiceMessageHandler : ICreateTargetServiceMessageHandler { - readonly ILog logger; + readonly ISystemLog logger; - public AzureWebAppServiceMessageHandler(ILog logger) + public AzureWebAppServiceMessageHandler(ISystemLog logger) { this.logger = logger; } diff --git a/source/Sashimi/Sashimi.csproj b/source/Sashimi/Sashimi.csproj index d1fb252..b56d7e8 100644 --- a/source/Sashimi/Sashimi.csproj +++ b/source/Sashimi/Sashimi.csproj @@ -26,5 +26,6 @@ + From ca1b11b58fa10cc782dd67f4206e5d8c4ef66c5e Mon Sep 17 00:00:00 2001 From: slewis74 Date: Tue, 9 Mar 2021 10:34:37 +1000 Subject: [PATCH 2/7] package update --- source/Sashimi/Sashimi.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/Sashimi/Sashimi.csproj b/source/Sashimi/Sashimi.csproj index b56d7e8..985a73f 100644 --- a/source/Sashimi/Sashimi.csproj +++ b/source/Sashimi/Sashimi.csproj @@ -26,6 +26,6 @@ - + From 9991ac5e87ec0a179f26282f6c5da31263ff9570 Mon Sep 17 00:00:00 2001 From: slewis74 Date: Tue, 9 Mar 2021 15:06:23 +1000 Subject: [PATCH 3/7] more package updates --- source/Calamari.Tests/Calamari.Tests.csproj | 2 +- source/Calamari/Calamari.csproj | 4 ++-- source/Sashimi.Tests/Sashimi.Tests.csproj | 4 ++-- source/Sashimi/AzureWebAppActionHandler.cs | 4 ++-- source/Sashimi/Sashimi.csproj | 8 ++++---- 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/source/Calamari.Tests/Calamari.Tests.csproj b/source/Calamari.Tests/Calamari.Tests.csproj index 53a3962..e4f85d1 100644 --- a/source/Calamari.Tests/Calamari.Tests.csproj +++ b/source/Calamari.Tests/Calamari.Tests.csproj @@ -7,7 +7,7 @@ - + diff --git a/source/Calamari/Calamari.csproj b/source/Calamari/Calamari.csproj index b561358..092f613 100644 --- a/source/Calamari/Calamari.csproj +++ b/source/Calamari/Calamari.csproj @@ -8,9 +8,9 @@ net452 - + - + diff --git a/source/Sashimi.Tests/Sashimi.Tests.csproj b/source/Sashimi.Tests/Sashimi.Tests.csproj index 749c3b6..3542625 100644 --- a/source/Sashimi.Tests/Sashimi.Tests.csproj +++ b/source/Sashimi.Tests/Sashimi.Tests.csproj @@ -17,9 +17,9 @@ - + - + \ No newline at end of file diff --git a/source/Sashimi/AzureWebAppActionHandler.cs b/source/Sashimi/AzureWebAppActionHandler.cs index 293f081..4fb568f 100644 --- a/source/Sashimi/AzureWebAppActionHandler.cs +++ b/source/Sashimi/AzureWebAppActionHandler.cs @@ -30,8 +30,8 @@ public IActionHandlerResult Execute(IActionHandlerContext context, ITaskLog task } return context.CalamariCommand(AzureConstants.CalamariAzure, "deploy-azure-web") - .WithCheckAccountIsNotManagementCertificate(context) - .WithAzureTools(context) + .WithCheckAccountIsNotManagementCertificate(context, taskLog) + .WithAzureTools(context, taskLog) .WithStagedPackageArgument() .Execute(taskLog); } diff --git a/source/Sashimi/Sashimi.csproj b/source/Sashimi/Sashimi.csproj index 985a73f..9820921 100644 --- a/source/Sashimi/Sashimi.csproj +++ b/source/Sashimi/Sashimi.csproj @@ -22,10 +22,10 @@ - - - - + + + + From 10a20a263eb150fbc80ed670d9d5584f5871318e Mon Sep 17 00:00:00 2001 From: Shannon Lewis Date: Wed, 10 Mar 2021 15:06:53 +1000 Subject: [PATCH 4/7] fixing reference to correct Autofac version --- source/Calamari.Tests/Calamari.Tests.csproj | 2 +- source/Calamari/Calamari.csproj | 2 +- source/Sashimi.Tests/Sashimi.Tests.csproj | 4 ++-- source/Sashimi/Sashimi.csproj | 6 +++--- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/source/Calamari.Tests/Calamari.Tests.csproj b/source/Calamari.Tests/Calamari.Tests.csproj index e4f85d1..c75fd95 100644 --- a/source/Calamari.Tests/Calamari.Tests.csproj +++ b/source/Calamari.Tests/Calamari.Tests.csproj @@ -7,7 +7,7 @@ - + diff --git a/source/Calamari/Calamari.csproj b/source/Calamari/Calamari.csproj index 092f613..d16e4de 100644 --- a/source/Calamari/Calamari.csproj +++ b/source/Calamari/Calamari.csproj @@ -10,7 +10,7 @@ - + diff --git a/source/Sashimi.Tests/Sashimi.Tests.csproj b/source/Sashimi.Tests/Sashimi.Tests.csproj index 3542625..1b2b272 100644 --- a/source/Sashimi.Tests/Sashimi.Tests.csproj +++ b/source/Sashimi.Tests/Sashimi.Tests.csproj @@ -17,9 +17,9 @@ - + - + \ No newline at end of file diff --git a/source/Sashimi/Sashimi.csproj b/source/Sashimi/Sashimi.csproj index 9820921..2f8faac 100644 --- a/source/Sashimi/Sashimi.csproj +++ b/source/Sashimi/Sashimi.csproj @@ -23,9 +23,9 @@ - - + + - + From cf338f55653c6c95f5b63aa0448b86dc1450288d Mon Sep 17 00:00:00 2001 From: slewis74 Date: Wed, 10 Mar 2021 19:36:43 +1000 Subject: [PATCH 5/7] scripting update --- source/Calamari/Calamari.csproj | 2 +- source/Sashimi/Sashimi.csproj | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/source/Calamari/Calamari.csproj b/source/Calamari/Calamari.csproj index d16e4de..72c438c 100644 --- a/source/Calamari/Calamari.csproj +++ b/source/Calamari/Calamari.csproj @@ -8,7 +8,7 @@ net452 - + diff --git a/source/Sashimi/Sashimi.csproj b/source/Sashimi/Sashimi.csproj index 2f8faac..902ac03 100644 --- a/source/Sashimi/Sashimi.csproj +++ b/source/Sashimi/Sashimi.csproj @@ -25,7 +25,7 @@ - + From 9ae2fa4abd1c144891874b1e28ae093a8bedd57f Mon Sep 17 00:00:00 2001 From: slewis74 Date: Thu, 18 Mar 2021 20:33:32 +1000 Subject: [PATCH 6/7] package updates --- source/Calamari.Tests/Calamari.Tests.csproj | 2 +- source/Calamari/Calamari.csproj | 4 ++-- source/Sashimi.Tests/Sashimi.Tests.csproj | 6 +++--- source/Sashimi/Sashimi.csproj | 6 +++--- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/source/Calamari.Tests/Calamari.Tests.csproj b/source/Calamari.Tests/Calamari.Tests.csproj index c75fd95..0c33bd7 100644 --- a/source/Calamari.Tests/Calamari.Tests.csproj +++ b/source/Calamari.Tests/Calamari.Tests.csproj @@ -7,7 +7,7 @@ - + diff --git a/source/Calamari/Calamari.csproj b/source/Calamari/Calamari.csproj index 72c438c..cbf03e1 100644 --- a/source/Calamari/Calamari.csproj +++ b/source/Calamari/Calamari.csproj @@ -9,8 +9,8 @@ - - + + diff --git a/source/Sashimi.Tests/Sashimi.Tests.csproj b/source/Sashimi.Tests/Sashimi.Tests.csproj index 1b2b272..b4ae209 100644 --- a/source/Sashimi.Tests/Sashimi.Tests.csproj +++ b/source/Sashimi.Tests/Sashimi.Tests.csproj @@ -17,9 +17,9 @@ - - - + + + \ No newline at end of file diff --git a/source/Sashimi/Sashimi.csproj b/source/Sashimi/Sashimi.csproj index 902ac03..820f575 100644 --- a/source/Sashimi/Sashimi.csproj +++ b/source/Sashimi/Sashimi.csproj @@ -23,9 +23,9 @@ - - + + - + From 03fa435327c16881a5f58b27fcadd3eff9f0c83a Mon Sep 17 00:00:00 2001 From: slewis74 Date: Thu, 18 Mar 2021 22:04:56 +1000 Subject: [PATCH 7/7] package updates --- source/Calamari/Calamari.csproj | 2 +- source/Sashimi/Sashimi.csproj | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/source/Calamari/Calamari.csproj b/source/Calamari/Calamari.csproj index cbf03e1..6f36b19 100644 --- a/source/Calamari/Calamari.csproj +++ b/source/Calamari/Calamari.csproj @@ -8,7 +8,7 @@ net452 - + diff --git a/source/Sashimi/Sashimi.csproj b/source/Sashimi/Sashimi.csproj index 820f575..e92eb25 100644 --- a/source/Sashimi/Sashimi.csproj +++ b/source/Sashimi/Sashimi.csproj @@ -25,7 +25,7 @@ - +