本文整理汇总了C#中IDeploymentSettingsManager.GetValue方法的典型用法代码示例。如果您正苦于以下问题:C# IDeploymentSettingsManager.GetValue方法的具体用法?C# IDeploymentSettingsManager.GetValue怎么用?C# IDeploymentSettingsManager.GetValue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IDeploymentSettingsManager
的用法示例。
在下文中一共展示了IDeploymentSettingsManager.GetValue方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AutoSwapHandler
public AutoSwapHandler(IDeploymentStatusManager deploymentStatusManager, IEnvironment environment, IDeploymentSettingsManager settings, ITraceFactory traceFactory)
{
_deploymentStatusManager = deploymentStatusManager;
_traceFactory = traceFactory;
_autoSwapSlotName = settings.GetValue("WEBSITE_SWAP_SLOTNAME");
_autoSwapLockFilePath = Path.Combine(environment.LocksPath, AutoSwapLockFile);
}
示例2: GetCurrentSiteBuilderFactory
private ISiteBuilderFactory GetCurrentSiteBuilderFactory(IDeploymentSettingsManager settingsManager)
{
string setting = settingsManager.GetValue(SettingsKeys.SiteBuilderFactory);
if (String.Equals(setting, Original, StringComparison.OrdinalIgnoreCase))
{
return _originalSiteBuilderFactory;
}
// Default
return _generatorSiteBuilderFactory;
}
示例3: GetTimeSpan
private static TimeSpan GetTimeSpan(IDeploymentSettingsManager settings, string settingsKey, TimeSpan defaultValue)
{
string value = settings.GetValue(settingsKey);
int seconds;
if (Int32.TryParse(value, out seconds))
{
return TimeSpan.FromSeconds(seconds >= 0 ? seconds : 0);
}
return defaultValue;
}
示例4: CreateBuilder
public ISiteBuilder CreateBuilder(ITracer tracer, ILogger logger, IDeploymentSettingsManager settings)
{
string repositoryRoot = _environment.RepositoryPath;
// If there's a custom deployment file then let that take over.
var command = settings.GetValue(SettingsKeys.Command);
if (!String.IsNullOrEmpty(command))
{
return new CustomBuilder(repositoryRoot, _environment.TempPath, command, _propertyProvider, _environment.SiteRootPath, _environment.ScriptPath, settings);
}
// If the repository has an explicit pointer to a project path to be deployed
// then use it.
var targetProjectPath = settings.GetValue(SettingsKeys.Project);
if (!String.IsNullOrEmpty(targetProjectPath))
{
tracer.Trace("Found .deployment file in repository");
targetProjectPath = Path.GetFullPath(Path.Combine(repositoryRoot, targetProjectPath.TrimStart('/', '\\')));
// Try to resolve the project
return ResolveProject(repositoryRoot,
targetProjectPath,
settings,
tryWebSiteProject: true,
searchOption: SearchOption.TopDirectoryOnly);
}
// Get all solutions in the current repository path
var solutions = VsHelper.GetSolutions(repositoryRoot).ToList();
if (!solutions.Any())
{
return ResolveProject(repositoryRoot,
settings,
searchOption: SearchOption.AllDirectories);
}
// More than one solution is ambiguous
if (solutions.Count > 1)
{
// TODO: Show relative paths in error messages
ThrowAmbiguousSolutionsError(solutions);
}
// We have a solution
VsSolution solution = solutions[0];
// We need to determine what project to deploy so get a list of all web projects and
// figure out with some heuristic, which one to deploy.
// TODO: Pick only 1 and throw if there's more than one
VsSolutionProject project = solution.Projects.Where(p => p.IsWap || p.IsWebSite).FirstOrDefault();
if (project == null)
{
logger.Log(Resources.Log_NoDeployableProjects, solution.Path);
return new BasicBuilder(repositoryRoot, _environment.ScriptPath, _environment.SiteRootPath, settings);
}
if (project.IsWap)
{
return new WapBuilder(settings,
_propertyProvider,
repositoryRoot,
project.AbsolutePath,
_environment.TempPath,
solution.Path);
}
return new WebSiteBuilder(_propertyProvider,
repositoryRoot,
project.AbsolutePath,
solution.Path,
settings);
}
示例5: CreateBuilder
public ISiteBuilder CreateBuilder(ITracer tracer, ILogger logger, IDeploymentSettingsManager settings, IFileFinder fileFinder)
{
string repositoryRoot = _environment.RepositoryPath;
// Use the cached vs projects file finder for: a. better performance, b. ignoring solutions/projects under node_modules
fileFinder = new CachedVsProjectsFileFinder(fileFinder);
// If there's a custom deployment file then let that take over.
var command = settings.GetValue(SettingsKeys.Command);
if (!String.IsNullOrEmpty(command))
{
return new CustomBuilder(_environment, settings, _propertyProvider, repositoryRoot, command);
}
// If the user provided specific generator arguments, that overrides any detection logic
string scriptGeneratorArgs = settings.GetValue(SettingsKeys.ScriptGeneratorArgs);
if (!String.IsNullOrEmpty(scriptGeneratorArgs))
{
return new CustomGeneratorCommandSiteBuilder(_environment, settings, _propertyProvider, repositoryRoot, scriptGeneratorArgs);
}
// If the repository has an explicit pointer to a project path to be deployed
// then use it.
string targetProjectPath = settings.GetValue(SettingsKeys.Project);
if (!String.IsNullOrEmpty(targetProjectPath))
{
tracer.Trace("Specific project was specified: " + targetProjectPath);
targetProjectPath = Path.GetFullPath(Path.Combine(repositoryRoot, targetProjectPath.TrimStart('/', '\\')));
// Try to resolve the project
return ResolveProject(repositoryRoot,
targetProjectPath,
settings,
fileFinder,
tryWebSiteProject: true,
searchOption: SearchOption.TopDirectoryOnly);
}
// Get all solutions in the current repository path
var solutions = VsHelper.GetSolutions(repositoryRoot, fileFinder).ToList();
if (!solutions.Any())
{
return ResolveProject(repositoryRoot,
settings,
fileFinder,
searchOption: SearchOption.AllDirectories);
}
// More than one solution is ambiguous
if (solutions.Count > 1)
{
// TODO: Show relative paths in error messages
ThrowAmbiguousSolutionsError(solutions);
}
// We have a solution
VsSolution solution = solutions[0];
// We need to determine what project to deploy so get a list of all web projects and
// figure out with some heuristic, which one to deploy.
// TODO: Pick only 1 and throw if there's more than one
VsSolutionProject project = solution.Projects.Where(p => p.IsWap || p.IsWebSite || p.IsAspNetCore).FirstOrDefault();
if (project == null)
{
// Try executable type project
project = solution.Projects.Where(p => p.IsExecutable).FirstOrDefault();
if (project != null)
{
return new DotNetConsoleBuilder(_environment,
settings,
_propertyProvider,
repositoryRoot,
project.AbsolutePath,
solution.Path);
}
logger.Log(Resources.Log_NoDeployableProjects, solution.Path);
return ResolveNonAspProject(repositoryRoot, null, settings);
}
if (project.IsWap)
{
return new WapBuilder(_environment,
settings,
_propertyProvider,
repositoryRoot,
project.AbsolutePath,
solution.Path);
}
if (project.IsAspNetCore)
{
return new AspNetCoreBuilder(_environment,
settings,
_propertyProvider,
//.........这里部分代码省略.........
示例6: GetOutputPath
private static string GetOutputPath(IEnvironment environment, IDeploymentSettingsManager perDeploymentSettings)
{
string targetPath = perDeploymentSettings.GetValue(SettingsKeys.TargetPath);
if (!String.IsNullOrEmpty(targetPath))
{
targetPath = targetPath.Trim('\\', '/');
return Path.GetFullPath(Path.Combine(environment.WebRootPath, targetPath));
}
return environment.WebRootPath;
}