Пример #1
0
        public void Upgrade(ILogger logger, IDeploymentComponentFactory deploymentComponentFactory, NugetPackage installedPackage)
        {
            PerformanceLogger performanceLogger = new PerformanceLogger(logger);

            performanceLogger.Restart("Opening, Calculating and planing deployment component");
            using (ParallelReadableZipArchive upgradeZipArchive = Open(packagePathAndFileName))
            {
                if (upgradeZipArchive == null)
                {
                    throw new InvalidOperationException($"Source archive {packagePathAndFileName} not found.");
                }

                using (ParallelReadableZipArchive installedzipArchive = installedPackage?.Open())
                {
                    IReadOnlyCollection <ParallelReadableZipArchiveEntry> installedEntries = installedzipArchive?.Entries;
                    IReadOnlyCollection <ParallelReadableZipArchiveEntry> newEntries       = upgradeZipArchive.Entries;

                    IReadOnlyCollection <IDeploymentComponent> deploymentComponents = deploymentComponentFactory.CreateDeploymentComponents(this, installedPackage, installedEntries, newEntries);

                    performanceLogger.Stop();

                    performanceLogger.Restart("Execution of deployment activities");
                    UpgradeDeploymentComponents(deploymentComponents, newEntries);
                    performanceLogger.Stop();
                }
            }
        }
Пример #2
0
 public DeploymentController(
     ILogger logger,
     IDeploymentComponentFactory deploymentComponentFactory,
     INugetPackageRepository nugetPackageRepository,
     IPackageListRepository packageListRepository)
 {
     this.logger = logger;
     this.deploymentComponentFactory = deploymentComponentFactory;
     this.nugetPackageRepository     = nugetPackageRepository;
     this.packageListRepository      = packageListRepository;
 }