Skip to content
This repository was archived by the owner on May 2, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion source/Calamari.Tests/Calamari.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\Calamari\Calamari.csproj" />
<PackageReference Include="Calamari.Tests.Shared" Version="9.0.0" />
<PackageReference Include="Calamari.Tests.Shared" Version="11.0.0" />
<PackageReference Include="Microsoft.Azure.Management.ResourceManager.Fluent" Version="1.37.0" />
<PackageReference Include="Microsoft.Azure.Management.Fluent" Version="1.37.0" />
<PackageReference Include="nunit" Version="3.13.1" />
Expand Down
6 changes: 3 additions & 3 deletions source/Calamari/Calamari.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
<TargetFramework>net452</TargetFramework>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Calamari.AzureScripting" Version="11.0.0" />
<PackageReference Include="Calamari.Common" Version="18.1.0" />
<PackageReference Include="Calamari.Scripting" Version="9.0.0" />
<PackageReference Include="Calamari.AzureScripting" Version="12.0.0" />
<PackageReference Include="Calamari.Common" Version="19.1.0" />
<PackageReference Include="Calamari.Scripting" Version="11.0.0" />
<PackageReference Include="Microsoft.Azure.Management.ResourceManager" Version="3.7.3-preview" />
<PackageReference Include="Microsoft.Azure.Management.Websites" Version="3.1.0" />
<PackageReference Include="Microsoft.Rest.ClientRuntime" Version="2.3.21" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,19 @@
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
{
public class AzureWebAppServiceMessageHandlerFixture
{
ICreateTargetServiceMessageHandler serviceMessageHandler;
ILog logger;
ISystemLog logger;

[SetUp]
public void SetUp()
{
logger = Substitute.For<ILog>();
logger = Substitute.For<ISystemLog>();
serviceMessageHandler = new AzureWebAppServiceMessageHandler(logger);
}

Expand Down
6 changes: 3 additions & 3 deletions source/Sashimi.Tests/Sashimi.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@
<PackageReference Include="NSubstitute" Version="4.2.1" />
<PackageReference Include="nunit" Version="3.13.1" />
<PackageReference Include="NUnit3TestAdapter" Version="3.17.0" />
<PackageReference Include="Sashimi.Azure.Common" Version="10.0.0" />
<PackageReference Include="Octopus.Server.Tests.Extensibility" Version="12.1.1" />
<PackageReference Include="Sashimi.Tests.Shared" Version="9.0.0" />
<PackageReference Include="Sashimi.Azure.Common" Version="11.0.0" />
<PackageReference Include="Octopus.Server.Tests.Extensibility" Version="13.0.0" />
<PackageReference Include="Sashimi.Tests.Shared" Version="11.0.0" />
<PackageReference Include="TeamCity.VSTest.TestAdapter" Version="1.0.25" />
</ItemGroup>
</Project>
7 changes: 4 additions & 3 deletions source/Sashimi/AzureActionHandlerExtensions.cs
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -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;
Expand Down
9 changes: 5 additions & 4 deletions source/Sashimi/AzureWebAppActionHandler.cs
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -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));

Expand All @@ -29,10 +30,10 @@ public IActionHandlerResult Execute(IActionHandlerContext context)
}

return context.CalamariCommand(AzureConstants.CalamariAzure, "deploy-azure-web")
.WithCheckAccountIsNotManagementCertificate(context)
.WithAzureTools(context)
.WithCheckAccountIsNotManagementCertificate(context, taskLog)
.WithAzureTools(context, taskLog)
.WithStagedPackageArgument()
.Execute();
.Execute(taskLog);
}
}
}
9 changes: 5 additions & 4 deletions source/Sashimi/AzureWebAppHealthCheckActionHandler.cs
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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);
}
}
}
3 changes: 2 additions & 1 deletion source/Sashimi/AzureWebAppPackageContributor.cs
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -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<AzureWebAppActionHandler>()
Expand Down
4 changes: 2 additions & 2 deletions source/Sashimi/AzureWebAppServiceMessageHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
9 changes: 5 additions & 4 deletions source/Sashimi/Sashimi.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,10 @@
</None>
</ItemGroup>
<ItemGroup>
<PackageReference Include="Octopus.Configuration" Version="2.1.0" />
<PackageReference Include="Sashimi.Azure.Accounts" Version="9.0.0" />
<PackageReference Include="Sashimi.Azure.Common" Version="10.0.0" />
<PackageReference Include="Sashimi.AzureScripting" Version="11.0.0" />
<PackageReference Include="Octopus.Configuration" Version="3.0.0" />
<PackageReference Include="Sashimi.Azure.Accounts" Version="11.0.0" />
<PackageReference Include="Sashimi.Azure.Common" Version="11.0.0" />
<PackageReference Include="Sashimi.AzureScripting" Version="12.0.0" />
<PackageReference Include="Sashimi.Server.Contracts" Version="11.0.0" />
</ItemGroup>
</Project>