Skip to content
Open
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
1 change: 0 additions & 1 deletion credits/credits.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ Calamari is made possible thanks to the following great third-party products.
| Microsoft.DotNet.Analyzers.Compatibility | Microsoft | [https://github.com/dotnet/platform-compat](https://github.com/dotnet/platform-compat) | [MIT](https://github.com/dotnet/platform-compat/blob/master/LICENSE) |
| Microsoft.Identity.Client | Microsoft | [https://go.microsoft.com/fwlink/?linkid=844761](https://go.microsoft.com/fwlink/?linkid=844761) | [MIT](https://www.nuget.org/packages/Microsoft.Identity.Client/4.66.2/license) |
| Microsoft.Net.Http | Microsoft | [http://go.microsoft.com/fwlink/?LinkID=280055](http://go.microsoft.com/fwlink/?LinkID=280055) | [Microsoft .Net Library License](http://go.microsoft.com/fwlink/?LinkId=329770) |
| Microsoft.NETFramework.ReferenceAssemblies.net462 | Microsoft | [https://github.com/Microsoft/dotnet/tree/master/releases/reference-assemblies](https://github.com/Microsoft/dotnet/tree/master/releases/reference-assemblies) | [MIT](https://github.com/Microsoft/dotnet/blob/master/LICENSE) |
| Microsoft.Rest.ClientRuntime | Microsoft | [https://github.com/Azure/azure-sdk-for-net](https://github.com/Azure/azure-sdk-for-net) | [MIT](https://raw.githubusercontent.com/Microsoft/dotnet/master/LICENSE) |
| Microsoft.ServiceFabric | Microsoft | [http://aka.ms/servicefabric](http://aka.ms/servicefabric) | [Microsoft .Net Library License](http://www.microsoft.com/web/webpi/eula/net_library_eula_ENU.htm) |
| Microsoft.Web.Administration | Microsoft | [http://microsoft.com](http://microsoft.com) | [Undefined]() |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public override IEnumerable<KubernetesCluster> DiscoverClusters(string contextJs
var discoveredClusters = new List<KubernetesCluster>();

// There appears to be an issue where the azure client returns stale data
// We need to upgrade this to use the newer SDK, but we need to upgrade to .NET 4.6.2 to support that.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe Rob has a PR floating around that does this

// TODO: Upgrade from Microsoft.Azure.Management.Fluent to Azure.ResourceManager SDK
var resourceGroups = azureClient.ResourceGroups.List();
//we don't care about resource groups that are being deleted
foreach (var resourceGroup in resourceGroups.Where(rg => rg.ProvisioningState != "Deleting"))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,7 @@
</ItemGroup>

<!-- Extract dotnet-script zip files to support C# script execution -->
<Target Name="RunResolvePackageDependencies" Condition="'$(RunResolvePackageDependencies)' != ''" />
<Target Name="GetToolFiles" DependsOnTargets="RunResolvePackageDependencies">
<Target Name="GetToolFiles">
<ItemGroup>
<DotnetScriptFiles Include="$(MSBuildProjectDirectory)/../Calamari.Scripting/DotnetScript/dotnet-script.*.zip"/>
</ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@
using Newtonsoft.Json.Linq;
using NUnit.Framework;

// ReSharper disable MethodHasAsyncOverload - File.ReadAllTextAsync does not exist for .net framework targets

namespace Calamari.AzureResourceGroup.Tests
{
[TestFixture]
Expand Down Expand Up @@ -138,8 +136,8 @@ await CommandTestBuilder.CreateAsync<DeployAzureResourceGroupCommand, Program>()
public async Task Deploy_with_template_inline()
{
var packagePath = TestEnvironment.GetTestPath("Packages", "AzureResourceGroup");
var templateFileContent = File.ReadAllText(Path.Combine(packagePath, "azure_website_template.json"));
var paramsFileContent = File.ReadAllText(Path.Combine(packagePath, "azure_website_params.json"));
var templateFileContent = await File.ReadAllTextAsync(Path.Combine(packagePath, "azure_website_template.json"));
var paramsFileContent = await File.ReadAllTextAsync(Path.Combine(packagePath, "azure_website_params.json"));
var parameters = JObject.Parse(paramsFileContent)["parameters"].ToString();

await CommandTestBuilder.CreateAsync<DeployAzureResourceGroupCommand, Program>()
Expand All @@ -148,7 +146,7 @@ await CommandTestBuilder.CreateAsync<DeployAzureResourceGroupCommand, Program>()
AddDefaults(context);
context.Variables.Add(SpecialVariables.Action.Azure.ResourceGroupDeploymentMode, "Complete");
context.Variables.Add("Octopus.Action.Azure.TemplateSource", "Inline");
context.Variables.Add(SpecialVariables.Action.Azure.ResourceGroupTemplate, File.ReadAllText(Path.Combine(packagePath, "azure_website_template.json")));
context.Variables.Add(SpecialVariables.Action.Azure.ResourceGroupTemplate, templateFileContent);
context.Variables.Add(SpecialVariables.Action.Azure.ResourceGroupTemplateParameters, parameters);

context.WithFilesToCopy(packagePath);
Expand All @@ -164,8 +162,8 @@ await CommandTestBuilder.CreateAsync<DeployAzureResourceGroupCommand, Program>()
public async Task Deploy_Ensure_Tools_Are_Configured()
{
var packagePath = TestEnvironment.GetTestPath("Packages", "AzureResourceGroup");
var templateFileContent = File.ReadAllText(Path.Combine(packagePath, "azure_website_template.json"));
var paramsFileContent = File.ReadAllText(Path.Combine(packagePath, "azure_website_params.json"));
var templateFileContent = await File.ReadAllTextAsync(Path.Combine(packagePath, "azure_website_template.json"));
var paramsFileContent = await File.ReadAllTextAsync(Path.Combine(packagePath, "azure_website_params.json"));
var parameters = JObject.Parse(paramsFileContent)["parameters"].ToString();
const string psScript = @"
$ErrorActionPreference = 'Continue'
Expand All @@ -179,7 +177,7 @@ await CommandTestBuilder.CreateAsync<DeployAzureResourceGroupCommand, Program>()
AddDefaults(context);
context.Variables.Add(SpecialVariables.Action.Azure.ResourceGroupDeploymentMode, "Complete");
context.Variables.Add("Octopus.Action.Azure.TemplateSource", "Inline");
context.Variables.Add(SpecialVariables.Action.Azure.ResourceGroupTemplate, File.ReadAllText(Path.Combine(packagePath, "azure_website_template.json")));
context.Variables.Add(SpecialVariables.Action.Azure.ResourceGroupTemplate, templateFileContent);
context.Variables.Add(SpecialVariables.Action.Azure.ResourceGroupTemplateParameters, parameters);
context.Variables.Add(KnownVariables.Package.EnabledFeatures, KnownVariables.Features.CustomScripts);
context.Variables.Add(KnownVariables.Action.CustomScripts.GetCustomScriptStage(DeploymentStages.Deploy, ScriptSyntax.PowerShell), psScript);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@
</ItemGroup>

<!-- Extract dotnet-script zip files to support C# script execution -->
<Target Name="RunResolvePackageDependencies" Condition="'$(RunResolvePackageDependencies)' != ''" />
<Target Name="GetToolFiles" DependsOnTargets="RunResolvePackageDependencies">
<Target Name="GetToolFiles">
<ItemGroup>
<DotnetScriptFiles Include="$(MSBuildProjectDirectory)/../Calamari.Scripting/DotnetScript/dotnet-script.*.zip"/>
</ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,7 @@
</ItemGroup>

<!-- Extract dotnet-script zip files to support C# script execution -->
<Target Name="RunResolvePackageDependencies" Condition="'$(RunResolvePackageDependencies)' != ''" />
<Target Name="GetToolFiles" DependsOnTargets="RunResolvePackageDependencies">
<Target Name="GetToolFiles">
<ItemGroup>
<DotnetScriptFiles Include="$(MSBuildProjectDirectory)/../Calamari.Scripting/DotnetScript/dotnet-script.*.zip"/>
</ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
</Target>

<Target Name="CopyNetCoreShimFilesAfterBuild" AfterTargets="Build" DependsOnTargets="GetNetCoreShimFiles">
<Unzip SourceFiles="@(NetCoreShimFiles)" DestinationFolder="$(OutputPath)/netcoreshim" SkipUnchangedFiles="true" Condition="'$(IsWindowsNetCoreBuild)' == 'true'" />
<Unzip SourceFiles="@(NetCoreShimFiles)" DestinationFolder="$(OutputPath)/netcoreshim" SkipUnchangedFiles="true" Condition="$([MSBuild]::IsOSPlatform('Windows'))" />
<Unzip SourceFiles="@(NetCoreShimFiles)" DestinationFolder="$(OutDir)/netcoreshim" SkipUnchangedFiles="true" />
</Target>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -413,13 +413,10 @@ public async Task Deploy_WebApp_Ensure_Tools_Are_Configured()
az group list";
File.WriteAllText(Path.Combine(tempPath.DirectoryPath, "PreDeploy.ps1"), psScript);

// This should be references from Sashimi.Server.Contracts, since Calamari.AzureWebApp is a net461 project this cannot be included.
var AccountType = "Octopus.Account.AccountType";

await CommandTestBuilder.CreateAsync<DeployAzureWebCommand, Program>()
.WithArrange(context =>
{
context.Variables.Add(AccountType, "AzureServicePrincipal");
context.Variables.Add(SpecialVariables.Account.AccountType, "AzureServicePrincipal");
AddDefaults(context);
context.Variables.Add(KnownVariables.Package.EnabledFeatures, KnownVariables.Features.CustomScripts);
context.Variables.Add(KnownVariables.Action.CustomScripts.GetCustomScriptStage(DeploymentStages.Deploy, ScriptSyntax.PowerShell), psScript);
Expand Down
3 changes: 1 addition & 2 deletions source/Calamari.AzureWebApp/Calamari.AzureWebApp.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,7 @@
</Target>

<!-- Extract dotnet-script zip files to support C# script execution -->
<Target Name="RunResolvePackageDependencies" Condition="'$(RunResolvePackageDependencies)' != ''" />
<Target Name="GetToolFiles" DependsOnTargets="RunResolvePackageDependencies">
<Target Name="GetToolFiles">
<ItemGroup>
<DotnetScriptFiles Include="$(MSBuildProjectDirectory)/../Calamari.Scripting/DotnetScript/dotnet-script.*.zip"/>
</ItemGroup>
Expand Down
2 changes: 0 additions & 2 deletions source/Calamari.Common/Calamari.Common.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@
<PackageReference Include="SharpCompress" Version="0.37.2" />
<PackageReference Include="XPath2" Version="1.1.5" />
<PackageReference Include="YamlDotNet" Version="16.3.0" />
<PackageReference Include="System.ValueTuple" Version="4.5.0" />
<PackageReference Include="System.Diagnostics.Tracing" Version="4.3.0" />
</ItemGroup>

<ItemGroup>
Expand Down
1 change: 0 additions & 1 deletion source/Calamari.Common/CalamariFlavourProgram.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ protected virtual int Run(string[] args)
{
AppDomainConfiguration.SetDefaultRegexMatchTimeout();

SecurityProtocols.EnableAllSecurityProtocols();
var options = CommonOptions.Parse(args);

log.Verbose($"Calamari Version: {GetType().Assembly.GetInformationalVersion()}");
Expand Down
1 change: 0 additions & 1 deletion source/Calamari.Common/CalamariFlavourProgramAsync.cs
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,6 @@ protected async Task<int> Run(string[] args)
{
AppDomainConfiguration.SetDefaultRegexMatchTimeout();

SecurityProtocols.EnableAllSecurityProtocols();
var options = CommonOptions.Parse(args);

log.Verbose($"Calamari Version: {GetType().Assembly.GetInformationalVersion()}");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,6 @@ namespace Calamari.Common.Plumbing.Extensions
{
public class ScriptingEnvironment
{
public static bool IsNet45OrNewer()
{
// Class "ReflectionContext" exists from .NET 4.5 onwards.
return Type.GetType("System.Reflection.ReflectionContext", false) != null;
}

public static bool IsRunningOnMono()
{
var monoRuntime = Type.GetType("Mono.Runtime");
Expand Down
32 changes: 0 additions & 32 deletions source/Calamari.Common/Plumbing/SecurityProtocols.cs

This file was deleted.

2 changes: 0 additions & 2 deletions source/Calamari.Common/Plumbing/Variables/KnownVariables.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ public class KnownVariables
public static readonly string AppliedXmlConfigTransforms = "OctopusAppliedXmlConfigTransforms";
public static readonly string ShouldFailDeploymentOnSubstitutionFails = "OctopusShouldFailDeploymentOnSubstitutionFails";

public static readonly string NugetHttpTimeout = "OctopusNugetHttpTimeout";

public const string EnabledFeatureToggles = "OctopusEnabledFeatureToggles";

public static class Action
Expand Down
Loading