mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-17 02:51:36 -05:00
Refresh master with initial release/0.24 snapshot (#332)
* Initial port of release/0.24 source code * Fix additional headers * Fix a typo in launch.json
This commit is contained in:
@@ -52,20 +52,20 @@ function isBuildSigned(quality: string, commit: string): Promise<boolean> {
|
||||
});
|
||||
}
|
||||
|
||||
async function waitForSignedBuild(quality: string, commit: string): Promise<void> {
|
||||
let retries = 0;
|
||||
// async function waitForSignedBuild(quality: string, commit: string): Promise<void> {
|
||||
// let retries = 0;
|
||||
|
||||
while (retries < 180) {
|
||||
if (await isBuildSigned(quality, commit)) {
|
||||
return;
|
||||
}
|
||||
// while (retries < 180) {
|
||||
// if (await isBuildSigned(quality, commit)) {
|
||||
// return;
|
||||
// }
|
||||
|
||||
await new Promise<void>(c => setTimeout(c, 10000));
|
||||
retries++;
|
||||
}
|
||||
// await new Promise<void>(c => setTimeout(c, 10000));
|
||||
// retries++;
|
||||
// }
|
||||
|
||||
throw new Error('Timed out waiting for signed build');
|
||||
}
|
||||
// throw new Error('Timed out waiting for signed build');
|
||||
// }
|
||||
|
||||
async function main(quality: string): Promise<void> {
|
||||
const commit = execSync('git rev-parse HEAD', { encoding: 'utf8' }).trim();
|
||||
@@ -73,10 +73,10 @@ async function main(quality: string): Promise<void> {
|
||||
console.log(`Queueing signing request for '${quality}/${commit}'...`);
|
||||
await queueSigningRequest(quality, commit);
|
||||
|
||||
console.log('Waiting on signed build...');
|
||||
await waitForSignedBuild(quality, commit);
|
||||
// console.log('Waiting on signed build...');
|
||||
// await waitForSignedBuild(quality, commit);
|
||||
|
||||
console.log('Found signed build!');
|
||||
// console.log('Found signed build!');
|
||||
}
|
||||
|
||||
main(process.argv[2]).catch(err => {
|
||||
|
||||
@@ -68,6 +68,7 @@ interface Asset {
|
||||
mooncakeUrl: string;
|
||||
hash: string;
|
||||
sha256hash: string;
|
||||
size: number;
|
||||
}
|
||||
|
||||
function createOrUpdate(commit: string, quality: string, platform: string, type: string, release: NewDocument, asset: Asset, isUpdate: boolean): Promise<void> {
|
||||
@@ -156,7 +157,7 @@ async function publish(commit: string, quality: string, platform: string, type:
|
||||
|
||||
console.log('Publishing...');
|
||||
console.log('Quality:', quality);
|
||||
console.log('Platforn:', platform);
|
||||
console.log('Platform:', platform);
|
||||
console.log('Type:', type);
|
||||
console.log('Name:', name);
|
||||
console.log('Version:', version);
|
||||
@@ -165,6 +166,11 @@ async function publish(commit: string, quality: string, platform: string, type:
|
||||
console.log('Is Released:', isReleased);
|
||||
console.log('File:', file);
|
||||
|
||||
const stat = await new Promise<fs.Stats>((c, e) => fs.stat(file, (err, stat) => err ? e(err) : c(stat)));
|
||||
const size = stat.size;
|
||||
|
||||
console.log('Size:', size);
|
||||
|
||||
const stream = fs.createReadStream(file);
|
||||
const [sha1hash, sha256hash] = await Promise.all([hashStream('sha1', stream), hashStream('sha256', stream)]);
|
||||
|
||||
@@ -224,7 +230,8 @@ async function publish(commit: string, quality: string, platform: string, type:
|
||||
url: `${process.env['AZURE_CDN_URL']}/${quality}/${blobName}`,
|
||||
mooncakeUrl: `${process.env['MOONCAKE_CDN_URL']}/${quality}/${blobName}`,
|
||||
hash: sha1hash,
|
||||
sha256hash
|
||||
sha256hash,
|
||||
size
|
||||
};
|
||||
|
||||
const release = {
|
||||
|
||||
Reference in New Issue
Block a user