internal ApplicationManager(ISiteManager siteManager, Site site, string appName, ISettingsResolver settingsResolver) { _siteManager = siteManager; _site = site; _appName = appName; _settingsResolver = settingsResolver; // Always null in public Kudu, but makes the code more similar to private Kudu NetworkCredential credentials = null; SiteUrl = site.SiteUrl.ToString(); ServiceUrl = site.ServiceUrl.ToString(); DeploymentManager = new RemoteDeploymentManager(site.ServiceUrl + "api", credentials); SettingsManager = new RemoteDeploymentSettingsManager(site.ServiceUrl + "api/settings", credentials); LegacySettingsManager = new RemoteDeploymentLegacySettingsManager(site.ServiceUrl + "settings", credentials); LogStreamManager = new RemoteLogStreamManager(site.ServiceUrl + "api/logstream", credentials); SSHKeyManager = new RemoteSSHKeyManager(site.ServiceUrl + "api/sshkey", credentials); VfsManager = new RemoteVfsManager(site.ServiceUrl + "api/vfs", credentials); VfsWebRootManager = new RemoteVfsManager(site.ServiceUrl + "api/vfs/site/wwwroot", credentials); LiveScmVfsManager = new RemoteVfsManager(site.ServiceUrl + "api/scmvfs", credentials); ZipManager = new RemoteZipManager(site.ServiceUrl + "api/zip", credentials); RuntimeManager = new RemoteRuntimeManager(site.ServiceUrl + "api/diagnostics/runtime", credentials); CommandExecutor = new RemoteCommandExecutor(site.ServiceUrl + "api/command", credentials); ProcessManager = new RemoteProcessManager(site.ServiceUrl + "api/processes", credentials); WebHooksManager = new RemoteWebHooksManager(site.ServiceUrl + "api/hooks", credentials); RepositoryManager = new RemoteRepositoryManager(site.ServiceUrl + "api/scm", credentials); JobsManager = new RemoteJobsManager(site.ServiceUrl + "api", credentials); LogFilesManager = new RemoteLogFilesManager(site.ServiceUrl + "api/logs", credentials); SiteExtensionManager = new RemoteSiteExtensionManager(site.ServiceUrl + "api", credentials); var repositoryInfo = RepositoryManager.GetRepositoryInfo().Result; GitUrl = repositoryInfo.GitUrl.OriginalString; }
internal ApplicationManager(ISiteManager siteManager, Site site, string appName, ISettingsResolver settingsResolver) { _siteManager = siteManager; _site = site; _appName = appName; _settingsResolver = settingsResolver; SiteUrl = site.SiteUrl; ServiceUrl = site.ServiceUrl; DeploymentManager = new RemoteDeploymentManager(site.ServiceUrl + "deployments"); SettingsManager = new RemoteDeploymentSettingsManager(site.ServiceUrl + "settings"); LogStreamManager = new RemoteLogStreamManager(site.ServiceUrl + "logstream"); SSHKeyManager = new RemoteSSHKeyManager(site.ServiceUrl + "sshkey"); VfsManager = new RemoteVfsManager(site.ServiceUrl + "vfs"); VfsWebRootManager = new RemoteVfsManager(site.ServiceUrl + "vfs/site/wwwroot"); LiveScmVfsManager = new RemoteVfsManager(site.ServiceUrl + "scmvfs"); ZipManager = new RemoteZipManager(site.ServiceUrl + "zip"); CommandExecutor = new RemoteCommandExecutor(site.ServiceUrl + "command"); ProcessManager = new RemoteProcessManager(site.ServiceUrl + "diagnostics/processes"); WebHooksManager = new RemoteWebHooksManager(site.ServiceUrl + "hooks"); RepositoryManager = new RemoteRepositoryManager(site.ServiceUrl + "scm"); var repositoryInfo = RepositoryManager.GetRepositoryInfo().Result; GitUrl = repositoryInfo.GitUrl.OriginalString; }
public static Task <RepositoryInfo> GetRepositoryInfo(this IApplication application, ICredentials credentials) { var repositoryManager = new RemoteRepositoryManager(application.ServiceUrl + "live/scm"); repositoryManager.Credentials = credentials; return(repositoryManager.GetRepositoryInfo()); }
public static ApplicationManager CreateApplication(string applicationName) { var pathResolver = new DefaultPathResolver(PathHelper.ServiceSitePath, PathHelper.SitesPath); var siteManager = GetSiteManager(pathResolver); try { siteManager.DeleteSite(applicationName); } catch (Exception) { } Site site = siteManager.CreateSite(applicationName); string gitUrl = null; var repositoryManager = new RemoteRepositoryManager(site.ServiceUrl + "live/scm"); var repositoryInfo = repositoryManager.GetRepositoryInfo().Result; gitUrl = repositoryInfo.GitUrl.ToString(); return(new ApplicationManager(siteManager, site, applicationName, gitUrl) { SiteUrl = site.SiteUrl, ServiceUrl = site.ServiceUrl, DeploymentManager = new RemoteDeploymentManager(site.ServiceUrl + "deployments"), ProjectSystem = new RemoteProjectSystem(site.ServiceUrl + "live/files"), SettingsManager = new RemoteDeploymentSettingsManager(site.ServiceUrl + "settings"), RepositoryManager = repositoryManager }); }
public static Task <RepositoryInfo> GetRepositoryInfo(this IApplication application, ICredentials credentials) { var repositoryManager = new RemoteRepositoryManager(application.PrimaryServiceBinding + "api/scm", credentials); return(repositoryManager.GetRepositoryInfo()); }
public static ApplicationManager CreateApplication(string applicationName, string testName = null) { // Default the test name to the app name testName = testName ?? applicationName; TestTracer.Trace("Create application - {0}", applicationName); var pathResolver = new DefaultPathResolver(PathHelper.ServiceSitePath, PathHelper.SitesPath); var settingsResolver = new DefaultSettingsResolver(); var siteManager = GetSiteManager(pathResolver, settingsResolver); Site site; if (KuduUtils.ReuseSameSiteForAllTests) { // In site reuse mode, try to get the existing site, and create it if needed site = siteManager.GetSite(applicationName); if (site == null) { site = siteManager.CreateSite(applicationName); } } else { try { siteManager.DeleteSite(applicationName); } catch (Exception) { } site = siteManager.CreateSite(applicationName); } TestTracer.Trace("Using site - {0}", site.SiteUrl); string gitUrl = null; var repositoryManager = new RemoteRepositoryManager(site.ServiceUrl + "scm"); var repositoryInfo = repositoryManager.GetRepositoryInfo().Result; gitUrl = repositoryInfo.GitUrl.ToString(); var applicationManager = new ApplicationManager(siteManager, site, applicationName, gitUrl, settingsResolver) { SiteUrl = site.SiteUrl, ServiceUrl = site.ServiceUrl, DeploymentManager = new RemoteDeploymentManager(site.ServiceUrl + "deployments"), SettingsManager = new RemoteDeploymentSettingsManager(site.ServiceUrl + "settings"), LogStreamManager = new RemoteLogStreamManager(site.ServiceUrl + "logstream"), SSHKeyManager = new RemoteSSHKeyManager(site.ServiceUrl + "sshkey"), VfsManager = new RemoteVfsManager(site.ServiceUrl + "vfs"), VfsWebRootManager = new RemoteVfsManager(site.ServiceUrl + "vfs/site/wwwroot"), LiveScmVfsManager = new RemoteVfsManager(site.ServiceUrl + "scmvfs"), ZipManager = new RemoteZipManager(site.ServiceUrl + "zip"), CommandExecutor = new RemoteCommandExecutor(site.ServiceUrl + "command"), RepositoryManager = repositoryManager, }; return(applicationManager); }