Skip to content

Commit

Permalink
tfs: check both azure and mooncake when uploading assets
Browse files Browse the repository at this point in the history
  • Loading branch information
joaomoreno committed Jul 5, 2017
1 parent 5df9a15 commit 6afdf30
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions build/tfs/common/publish.ts
Original file line number Diff line number Diff line change
Expand Up @@ -188,17 +188,24 @@ async function publish(commit: string, quality: string, platform: string, type:
doesAssetExist(mooncakeBlobService, quality, blobName)
]);

if (blobExists || moooncakeBlobExists) {
const promises = [];

if (!blobExists) {
promises.push(uploadBlob(blobService, quality, blobName, file));
}

if (!moooncakeBlobExists) {
promises.push(uploadBlob(mooncakeBlobService, quality, blobName, file));
}

if (promises.length === 0) {
console.log(`Blob ${quality}, ${blobName} already exists, not publishing again.`);
return;
}

console.log('Uploading blobs to Azure storage...');

await Promise.all([
uploadBlob(blobService, quality, blobName, file),
uploadBlob(mooncakeBlobService, quality, blobName, file)
]);
await Promise.all(promises);

console.log('Blobs successfully uploaded.');

Expand Down

0 comments on commit 6afdf30

Please sign in to comment.