public async Task TestHasBinaries() { Assert.False(await _deploymentRepository.HasApplicationBinaries(TestAppIdentity)); await UploadTestApplicationBinaries(ConflictResolutionMode.FailIfBinariesExist, "some json"); Assert.True(await _deploymentRepository.HasApplicationBinaries(TestAppIdentity)); }
public async Task <IEnumerable <AppIdentity> > FetchDeployments(string deploymentId) { var apps = new HashSet <AppIdentity>(); DeploymentConfig deploymentConfig = await _deploymentRepository.FetchDeploymentConfig(); foreach (string appId in deploymentConfig.ListApplications(deploymentId)) { foreach (string version in deploymentConfig.ListVersions(appId, deploymentId)) { AppIdentity appIdentity = new AppIdentity(appId, version); try { if (!await _deploymentRepository.HasApplicationBinaries(appIdentity)) { Trace.TraceError($"Could not binaries for application {appIdentity} in the yams repository"); continue; } apps.Add(appIdentity); } catch (Exception e) { Trace.TraceError($"Exception occured while loading application {appIdentity}, Exception: {e}"); } } } return(apps); }
public async Task <IEnumerable <AppDeploymentConfig> > FetchDeployments() { var apps = new HashSet <AppDeploymentConfig>(); DeploymentConfig deploymentConfig = await _deploymentRepository.FetchDeploymentConfig(); foreach (AppDeploymentConfig appDeploymentConfig in deploymentConfig.Where(_appDeploymentMatcher.IsMatch)) { AppIdentity appIdentity = appDeploymentConfig.AppIdentity; try { if (!await _deploymentRepository.HasApplicationBinaries(appIdentity)) { Trace.TraceError($"Could not find binaries for application {appIdentity} in the yams repository"); continue; } apps.Add(appDeploymentConfig); } catch (Exception e) { Trace.TraceError($"Exception occured while loading application {appIdentity}, Exception: {e}"); } } return(apps); }