コード例 #1
0
        public async Task <bool> PushItemToFeed(string item, string relativePath, SemaphoreSlim clientThrottle, bool allowOverwrite)
        {
            try
            {
                string uploadPath       = feed.CalculateBlobPath(item, relativePath);
                string packageDirectory = feed.CalculateRelativeUploadPath(item, relativePath);

                await UploadAsync(CancellationToken, item, uploadPath, clientThrottle, allowOverwrite);

                List <string> listAzureBlobs = await ListAzureBlobs.ListBlobs(Log, feed.AccountName, feed.AccountKey, feed.ContainerName, packageDirectory);

                if (!listAzureBlobs.Any(x => x.Contains(uploadPath)))
                {
                    throw new Exception($"Uploaded package {uploadPath} is not present on feed. Cannot update index.json.");
                }

                await UploadIndexJson(clientThrottle, true, packageDirectory, listAzureBlobs);
            }
            catch (Exception e)
            {
                Log.LogErrorFromException(e);
            }

            return(!Log.HasLoggedErrors);
        }
コード例 #2
0
 public string[] GetBlobList(string path)
 {
     return(ListAzureBlobs.Execute(AccountName,
                                   AccountKey,
                                   ConnectionString,
                                   ContainerName,
                                   path,
                                   BuildEngine,
                                   HostObject));
 }