private void DoGitPush(ApplicationManager appManager, TestRepository testRepository, string appName, string verificationContent) { appManager.GitDeploy(testRepository.PhysicalPath, "master"); var results = appManager.DeploymentManager.GetResultsAsync().Result.ToList(); if (results[0].Status != Kudu.Core.Deployment.DeployStatus.Success) { string msg = string.Format("Deployment of app {0} failed. Deployment count: {1} . Deployment Status: {2}", appName, results.Count, results[0].Status); throw new ApplicationException(msg); } StressUtils.VerifySite(appManager.SiteUrl, verificationContent); }
private void DoGitRedeploy(ApplicationManager appManager, string commitId, string verificationContent) { DeployResult result = null; try { appManager.DeploymentManager.DeployAsync(commitId).Wait(); var results = appManager.DeploymentManager.GetResultsAsync().Result.ToList(); result = results.Where(r => r.Id == commitId).FirstOrDefault(); } catch (Exception ex) { string msg = string.Format("Redeploy operation failed for commit ID: {0}. Exception: {1}", commitId, ex.ToString()); throw new ApplicationException(msg); } if (result == null) { string msg = string.Format("Redeploy operation completed but expected commit Id was not deployed. Commit ID: {0}.", commitId); throw new ApplicationException(msg); } StressUtils.VerifySite(appManager.SiteUrl, verificationContent); }