public void Deploy() { OctopusTestAzureSubscription.IgnoreIfCertificateNotInstalled(); var nugetPackageFile = PackageBuilder.BuildSamplePackage("Octopus.Sample.AzureCloudService", "1.0.0"); var variablesFile = Path.GetTempFileName(); var variables = new VariableDictionary(); OctopusTestAzureSubscription.PopulateVariables(variables); OctopusTestCloudService.PopulateVariables(variables); variables.Set(SpecialVariables.Action.Azure.Slot, "Staging"); variables.Set(SpecialVariables.Action.Azure.SwapIfPossible, false.ToString()); variables.Set(SpecialVariables.Action.Azure.UseCurrentInstanceCount, false.ToString()); variables.Set(SpecialVariables.Action.Name, "AzureCloudService"); variables.Set(SpecialVariables.Release.Number, "1.0.0"); // Disable cspkg extraction variables.Set(SpecialVariables.Action.Azure.CloudServicePackageExtractionDisabled, true.ToString()); fileSystem = new WindowsPhysicalFileSystem(); stagingDirectory = Path.GetTempPath(); variables.Set(SpecialVariables.Action.Azure.PackageExtractionPath, stagingDirectory); variables.Save(variablesFile); result = Invoke( Calamari() .Action("deploy-azure-cloud-service") .Argument("package", nugetPackageFile) .Argument("variables", variablesFile)); }
public void ShouldRemoveArtifactsWhenReleasesSpecified() { result = Clean("retentionPolicySet1", null, 1); result.AssertZero(); Assert.False(fileSystem.DirectoryExists(Path.Combine(stagingDirectory, "Acme.1.0.0"))); Assert.False(fileSystem.FileExists(Path.Combine(packagesDirectory, "Acme.1.0.0.nupkg"))); }
public void Deploy() { const string webAppName = "octodemo003-dev"; OctopusTestAzureSubscription.IgnoreIfCertificateNotInstalled(); variables = new VariableDictionary(); OctopusTestAzureSubscription.PopulateVariables(variables); variables.Set(SpecialVariables.Action.Azure.WebAppName, webAppName); variables.Set("foo", "bar"); // Enable file substitution and configure the target variables.Set(SpecialVariables.Package.SubstituteInFilesEnabled, true.ToString()); variables.Set(SpecialVariables.Package.SubstituteInFilesTargets, "web.config"); fileSystem = new WindowsPhysicalFileSystem(); stagingDirectory = Path.GetTempPath(); variables.Set(SpecialVariables.Action.Azure.PackageExtractionPath, stagingDirectory); result = DeployPackage("Acme.Web"); }
static void AssertStagePackageOutputVariableSet(CalamariResult result, string filePath) { result.AssertOutputVariable("StagedPackage.FullPathOnRemoteMachine", Is.StringStarting(filePath)); }
static void AssertPackageSizeMatchesExpected(CalamariResult result, long expectedSize) { result.AssertOutputVariable("StagedPackage.Size", Is.EqualTo(expectedSize.ToString(CultureInfo.InvariantCulture))); }
static void AssertPackageHashMatchesExpected(CalamariResult result, string expectedHash) { result.AssertOutputVariable("StagedPackage.Hash", Is.EqualTo(expectedHash)); }