本文整理汇总了C#中IDeploymentSettingsManager.GetRepositoryPath方法的典型用法代码示例。如果您正苦于以下问题:C# IDeploymentSettingsManager.GetRepositoryPath方法的具体用法?C# IDeploymentSettingsManager.GetRepositoryPath怎么用?C# IDeploymentSettingsManager.GetRepositoryPath使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IDeploymentSettingsManager
的用法示例。
在下文中一共展示了IDeploymentSettingsManager.GetRepositoryPath方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: PerformDeploy
private static int PerformDeploy(
string appRoot,
string wapTargets,
string deployer,
string lockPath,
IEnvironment env,
IDeploymentSettingsManager settingsManager,
TraceLevel level,
ITracer tracer,
ITraceFactory traceFactory,
IOperationLock deploymentLock)
{
System.Environment.SetEnvironmentVariable("GIT_DIR", null, System.EnvironmentVariableTarget.Process);
// Skip SSL Certificate Validate
OperationClient.SkipSslValidationIfNeeded();
// Adjust repo path
env.RepositoryPath = Path.Combine(env.SiteRootPath, settingsManager.GetRepositoryPath());
string statusLockPath = Path.Combine(lockPath, Constants.StatusLockFile);
string hooksLockPath = Path.Combine(lockPath, Constants.HooksLockFile);
IOperationLock statusLock = new LockFile(statusLockPath, traceFactory);
IOperationLock hooksLock = new LockFile(hooksLockPath, traceFactory);
IBuildPropertyProvider buildPropertyProvider = new BuildPropertyProvider();
ISiteBuilderFactory builderFactory = new SiteBuilderFactory(buildPropertyProvider, env);
var logger = new ConsoleLogger();
IRepository gitRepository;
if (settingsManager.UseLibGit2SharpRepository())
{
gitRepository = new LibGit2SharpRepository(env, settingsManager, traceFactory);
}
else
{
gitRepository = new GitExeRepository(env, settingsManager, traceFactory);
}
IServerConfiguration serverConfiguration = new ServerConfiguration();
IAnalytics analytics = new Analytics(settingsManager, serverConfiguration, traceFactory);
IWebHooksManager hooksManager = new WebHooksManager(tracer, env, hooksLock);
IDeploymentStatusManager deploymentStatusManager = new DeploymentStatusManager(env, analytics, statusLock);
IAutoSwapHandler autoSwapHander = new AutoSwapHandler(env, settingsManager, traceFactory);
var functionManager = new FunctionManager(env, traceFactory);
IDeploymentManager deploymentManager = new DeploymentManager(builderFactory,
env,
traceFactory,
analytics,
settingsManager,
deploymentStatusManager,
deploymentLock,
GetLogger(env, level, logger),
hooksManager,
functionManager);
var step = tracer.Step(XmlTracer.ExecutingExternalProcessTrace, new Dictionary<string, string>
{
{ "type", "process" },
{ "path", "kudu.exe" },
{ "arguments", appRoot + " " + wapTargets }
});
using (step)
{
try
{
deploymentManager.DeployAsync(gitRepository, changeSet: null, deployer: deployer, clean: false)
.Wait();
string branch = settingsManager.GetBranch();
ChangeSet changeSet = gitRepository.GetChangeSet(branch);
IDeploymentStatusFile statusFile = deploymentStatusManager.Open(changeSet.Id);
if (statusFile != null && statusFile.Status == DeployStatus.Success)
{
autoSwapHander.HandleAutoSwap(changeSet.Id, deploymentManager.GetLogger(changeSet.Id), tracer).Wait();
}
}
catch (Exception e)
{
tracer.TraceError(e);
System.Console.Error.WriteLine(e.GetBaseException().Message);
System.Console.Error.WriteLine(Resources.Log_DeploymentError);
return 1;
}
}
if (logger.HasErrors)
{
System.Console.Error.WriteLine(Resources.Log_DeploymentError);
return 1;
}
return 0;
}
示例2: GetEnvironment
private static IEnvironment GetEnvironment(IDeploymentSettingsManager settings = null)
{
string siteRoot = PathResolver.ResolveSiteRootPath();
string root = Path.GetFullPath(Path.Combine(siteRoot, ".."));
string webRootPath = Path.Combine(siteRoot, Constants.WebRoot);
string deployCachePath = Path.Combine(siteRoot, Constants.DeploymentCachePath);
string diagnosticsPath = Path.Combine(siteRoot, Constants.DiagnosticsPath);
string sshKeyPath = Path.Combine(siteRoot, Constants.SSHKeyPath);
string repositoryPath = Path.Combine(siteRoot, settings == null ? Constants.RepositoryPath : settings.GetRepositoryPath());
string tempPath = Path.GetTempPath();
string scriptPath = Path.Combine(HttpRuntime.BinDirectory, Constants.ScriptsPath);
string nodeModulesPath = Path.Combine(HttpRuntime.BinDirectory, Constants.NodeModulesPath);
return new Kudu.Core.Environment(
new FileSystem(),
root,
siteRoot,
tempPath,
repositoryPath,
webRootPath,
deployCachePath,
diagnosticsPath,
sshKeyPath,
scriptPath,
nodeModulesPath);
}
示例3: GetEnvironment
private static IEnvironment GetEnvironment(IDeploymentSettingsManager settings = null)
{
string root = PathResolver.ResolveRootPath();
string siteRoot = Path.Combine(root, Constants.SiteFolder);
string repositoryPath = Path.Combine(siteRoot, settings == null ? Constants.RepositoryPath : settings.GetRepositoryPath());
return new Kudu.Core.Environment(
root,
HttpRuntime.BinDirectory,
repositoryPath);
}
示例4: MockEnviroment
private Mock<IEnvironment> MockEnviroment(string sitePath, IDeploymentSettingsManager settings)
{
var environment = new Mock<IEnvironment>(MockBehavior.Strict);
// setup
environment.SetupGet(e => e.RepositoryPath)
.Returns(() => Path.Combine(sitePath, settings.GetRepositoryPath()));
return environment;
}