Ejemplo n.º 1
0
        private async Task <int> CopyApplicationZipFiles(List <string> selectedAppFiles, List <string> applicationExportingLogs)
        {
            var sourceFiles = GetApplicationZipFiles();
            var counter     = 0;

            foreach (var sourceKey in sourceFiles)
            {
                if (!selectedAppFiles.Contains(sourceKey))
                {
                    continue;
                }

                var destinationKey = sourceKey.Replace(appsSourceFolder, appsDestinationFolder);
                try
                {
                    await s3ArtifactHelper.CopyFile(s3ArtifactHelper.BucketName, sourceKey, s3ArtifactHelper.BucketName, destinationKey);
                }
                catch (Exception ex)
                {
                    UpdateApplicationException(applicationExportingLogs, ex);
                    continue;
                }
                UpdateApplicationExportingLogs(applicationExportingLogs, $"{sourceKey} copied to {destinationKey}");
                counter++;
            }
            return(counter);
        }