Skip to content
Open
Show file tree
Hide file tree
Changes from 4 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`))' == 'true'" />
Comment thread
sathvikkumar-octo marked this conversation as resolved.
Outdated
<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
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
<PackageReference Include="nunit" Version="3.14.0" />
<PackageReference Include="NUnit3TestAdapter" Version="5.2.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="18.0.0" />
<PackageReference Include="System.Runtime.InteropServices.RuntimeInformation" Version="4.3.0" />
<PackageReference Include="TeamCity.VSTest.TestAdapter" Version="1.0.41" />
<PackageReference Include="Google.Cloud.Storage.V1" Version="2.5.0" />
<PackageReference Include="SharpZipLib" Version="1.3.3" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,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
3 changes: 0 additions & 3 deletions source/Calamari.Shared/Calamari.Shared.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -38,17 +38,14 @@
<PackageReference Include="Octostache" Version="3.9.2" />
<PackageReference Include="SharpCompress" Version="0.37.2" />
<PackageReference Include="Sprache" Version="2.3.1" />
<PackageReference Include="System.ValueTuple" Version="4.5.0" />
<PackageReference Include="YamlDotNet" Version="16.3.0" />
<PackageReference Include="Microsoft.Web.Xdt" Version="3.1.0" />
<PackageReference Include="System.Diagnostics.Tracing" Version="4.3.0" />
<PackageReference Include="Polly" Version="8.3.1" />
<PackageReference Include="NuGet.Commands" Version="7.0.1" />
<PackageReference Include="Markdown" Version="2.1.0" />
<PackageReference Include="System.IO.FileSystem.AccessControl" Version="5.0.0" />
<PackageReference Include="System.Text.Encoding.CodePages" Version="8.0.0" />
<PackageReference Include="System.Threading.AccessControl" Version="4.3.0" />
<PackageReference Include="System.IO.FileSystem" Version="4.3.0" />
<PackageReference Include="System.IO.Packaging" Version="4.3.0" />
</ItemGroup>
<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ public PackagePhysicalFileMetadata DownloadPackage(string packageId,
int maxDownloadAttempts,
TimeSpan downloadAttemptBackoff)
{
ServicePointManager.SecurityProtocol |= (SecurityProtocolType)3072;
var cacheDirectory = PackageDownloaderUtils.GetPackageRoot(feedId);
fileSystem.EnsureDirectoryExists(cacheDirectory);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ public PackagePhysicalFileMetadata DownloadPackage(
int maxDownloadAttempts,
TimeSpan downloadAttemptBackoff)
{
ServicePointManager.SecurityProtocol |= (SecurityProtocolType)3072;
var cacheDirectory = PackageDownloaderUtils.GetPackageRoot(feedId);
fileSystem.EnsureDirectoryExists(cacheDirectory);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,20 +99,8 @@ private void DownloadPackageAction(string packageId, IVersion version, Uri feedU
}


WarnIfHttpTimeoutHasBeenSet();
NuGetV3LibDownloader.DownloadPackage(packageId, version, feedUri, feedCredentials, targetFilePath);
}

void WarnIfHttpTimeoutHasBeenSet()
{
if (variables.IsSet(KnownVariables.NugetHttpTimeout))
{
Log.Warn(
$"A Nuget HTTP timeout was set via the '{KnownVariables.NugetHttpTimeout}' variable. "
+ "This variable is only supported when running on .NET Framework."
);
}
}

bool IsHttp(string uri)
{
Expand Down
Loading