本文整理汇总了C#中VariableDictionary.EnrichWithEnvironmentVariables方法的典型用法代码示例。如果您正苦于以下问题:C# VariableDictionary.EnrichWithEnvironmentVariables方法的具体用法?C# VariableDictionary.EnrichWithEnvironmentVariables怎么用?C# VariableDictionary.EnrichWithEnvironmentVariables使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类VariableDictionary
的用法示例。
在下文中一共展示了VariableDictionary.EnrichWithEnvironmentVariables方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SetUp
public void SetUp()
{
fileSystem = CalamariPhysicalFileSystem.GetPhysicalFileSystem();
// Ensure tenticle directory exists
tentacleDirectory = Path.Combine(Path.GetTempPath(), "CalamariTestTentacle");
var tentacleHiddenDirectory = Path.Combine(tentacleDirectory, ".tentacle");
fileSystem.EnsureDirectoryExists(tentacleDirectory);
fileSystem.EnsureDirectoryExists(tentacleHiddenDirectory);
fileSystem.PurgeDirectory(tentacleHiddenDirectory, FailureOptions.ThrowOnFailure);
Environment.SetEnvironmentVariable("TentacleJournal", Path.Combine(tentacleHiddenDirectory, "DeploymentJournal.xml" ));
variables = new VariableDictionary();
variables.EnrichWithEnvironmentVariables();
deploymentJournal = new DeploymentJournal(fileSystem, new SystemSemaphore(), variables);
packagesDirectory = Path.Combine(Path.GetTempPath(), "CalamariTestPackages");
fileSystem.EnsureDirectoryExists(packagesDirectory);
stagingDirectory = Path.Combine(Path.GetTempPath(), "CalamariTestStaging");
fileSystem.EnsureDirectoryExists(stagingDirectory);
// Create some artificats
const string retentionPolicySet1 = "retentionPolicySet1";
CreateDeployment(Path.Combine(packagesDirectory, "Acme.1.0.0.nupkg"), Path.Combine(stagingDirectory, "Acme.1.0.0"),
new DateTimeOffset(new DateTime(2015, 01, 26), new TimeSpan(10, 0,0)), retentionPolicySet1);
CreateDeployment(Path.Combine(packagesDirectory, "Acme.1.1.0.nupkg"), Path.Combine(stagingDirectory, "Acme.1.1.0"),
new DateTimeOffset(new DateTime(2015, 02, 01), new TimeSpan(10, 0,0)), retentionPolicySet1);
CreateDeployment(Path.Combine(packagesDirectory, "Acme.1.2.0.nupkg"), Path.Combine(stagingDirectory, "Acme.1.2.0"),
new DateTimeOffset(new DateTime(2015, 02, 10), new TimeSpan(10, 0,0)), retentionPolicySet1);
}
示例2: SetUp
public void SetUp()
{
fileSystem = CalamariPhysicalFileSystem.GetPhysicalFileSystem();
// Ensure staging directory exists and is empty
stagingDirectory = Path.Combine(Path.GetTempPath(), "CalamariTestStaging");
customDirectory = Path.Combine(Path.GetTempPath(), "CalamariTestCustom");
fileSystem.EnsureDirectoryExists(stagingDirectory);
fileSystem.PurgeDirectory(stagingDirectory, FailureOptions.ThrowOnFailure);
Environment.SetEnvironmentVariable("TentacleJournal", Path.Combine(stagingDirectory, "DeploymentJournal.xml" ));
variables = new VariableDictionary();
variables.EnrichWithEnvironmentVariables();
variables.Set(SpecialVariables.Tentacle.Agent.ApplicationDirectoryPath, stagingDirectory);
variables.Set("PreDeployGreeting", "Bonjour");
}
示例3: Execute
public override int Execute(string[] commandLineArguments)
{
Options.Parse(commandLineArguments);
Guard.NotNullOrWhiteSpace(retentionPolicySet, "No retention-policy-set was specified. Please pass --retentionPolicySet \"Environments-2/projects-161/Step-Package B/machines-65/<default>\"");
if (days <=0 && releases <= 0)
throw new CommandException("A value must be provided for either --days or --releases");
var variables = new VariableDictionary();
variables.EnrichWithEnvironmentVariables();
var fileSystem = CalamariPhysicalFileSystem.GetPhysicalFileSystem();
var deploymentJournal = new DeploymentJournal(fileSystem, new SystemSemaphore(), variables);
var clock = new SystemClock();
var retentionPolicy = new RetentionPolicy(fileSystem, deploymentJournal, clock);
retentionPolicy.ApplyRetentionPolicy(retentionPolicySet, days, releases);
return 0;
}