示例#1
0
        protected override void DoExecute()
        {
            // artifacts downloaded by previous executed html api (not REST!) are packed one more time in zip archive :/ move to separate step?
            if (!_fileAdapter.Exists(_artifactsFilePath))
            {
                throw new InvalidOperationException(string.Format("Couldn't extract ZIP archive because it doesn't exist: '{0}'.", _artifactsFilePath));
            }

            _zipFileAdapter.ExtractAll(_artifactsFilePath, _targetArtifactsDirPath, true);

            string projectArchiveFileName =
                string.Format(
                    @"{0}_{1}.zip",
                    _projectInfo.ArtifactsRepositoryName,
                    _deploymentInfo.ProjectConfigurationName);

            string archivePath = Path.Combine(_targetArtifactsDirPath, projectArchiveFileName);

            // unpacking internal zip package, true is that inside are packed artifacts with name like [Project_BuildConfigName.zip]
            if (!_fileAdapter.Exists(archivePath))
            {
                throw new InvalidOperationException(string.Format("Couldn't extract internal ZIP archive because it doesn't exist: '{0}'.", archivePath));
            }

            _zipFileAdapter.ExtractAll(archivePath, _targetArtifactsDirPath, true);
        }