tfs: upload darwin signed only

This commit is contained in:
Joao Moreno 2017-05-22 09:46:40 +02:00
parent afb94f4ec0
commit bc46331a48
3 changed files with 20 additions and 6 deletions

View file

@ -12,6 +12,7 @@
"azure-storage": "^2.1.0",
"documentdb": "^1.11.0",
"mime": "^1.3.4",
"minimist": "^1.2.0",
"typescript": "^2.2.2",
"xml2js": "^0.4.17"
},
@ -20,4 +21,4 @@
"watch": "tsc --watch",
"postinstall": "npm run compile"
}
}
}

View file

@ -10,6 +10,7 @@ import { execSync } from 'child_process';
import * as crypto from 'crypto';
import * as azure from 'azure-storage';
import * as mime from 'mime';
import * as minimist from 'minimist';
import { DocumentClient, NewDocument } from 'documentdb';
if (process.argv.length < 6) {
@ -137,7 +138,11 @@ async function uploadBlob(blobService: azure.BlobService, quality: string, blobN
await new Promise((c, e) => blobService.createBlockBlobFromLocalFile(quality, blobName, file, blobOptions, err => err ? e(err) : c()));
}
async function publish(commit: string, quality: string, platform: string, type: string, name: string, version: string, _isUpdate: string, file: string): Promise<void> {
interface PublishOptions {
'upload-only': boolean;
}
async function publish(commit: string, quality: string, platform: string, type: string, name: string, version: string, _isUpdate: string, file: string, opts: PublishOptions): Promise<void> {
const isUpdate = _isUpdate === 'true';
const queuedBy = process.env['BUILD_QUEUEDBY'];
@ -193,6 +198,10 @@ async function publish(commit: string, quality: string, platform: string, type:
console.log('Blobs successfully uploaded.');
if (opts['upload-only']) {
return;
}
const config = await getConfig(quality);
console.log('Quality config:', config);
@ -224,10 +233,14 @@ async function publish(commit: string, quality: string, platform: string, type:
}
function main(): void {
const [, , quality, platform, type, name, version, _isUpdate, file] = process.argv;
const opts = minimist<PublishOptions>(process.argv.slice(2), {
boolean: ['upload-only']
});
const [quality, platform, type, name, version, _isUpdate, file] = opts._;
const commit = execSync('git rev-parse HEAD', { encoding: 'utf8' }).trim();
publish(commit, quality, platform, type, name, version, _isUpdate, file).catch(err => {
publish(commit, quality, platform, type, name, version, _isUpdate, file, opts).catch(err => {
console.error(err);
process.exit(1);
});

View file

@ -46,8 +46,8 @@ rm -rf $UNSIGNEDZIP
step "Create unsigned archive" \
zip -r -X -y $UNSIGNEDZIP *)
step "Publish unsigned archive" \
node build/tfs/common/publish.js $VSCODE_QUALITY darwin archive-unsigned VSCode-darwin-$VSCODE_QUALITY-unsigned.zip $VERSION false $UNSIGNEDZIP
step "Upload unsigned archive" \
node build/tfs/common/publish.js --upload-only $VSCODE_QUALITY darwin archive-unsigned VSCode-darwin-$VSCODE_QUALITY-unsigned.zip $VERSION false $UNSIGNEDZIP
step "Sign build" \
node build/tfs/common/enqueue.js $VSCODE_QUALITY