mirror of
https://github.com/microsoft/vscode.git
synced 2026-05-02 22:41:31 +01:00
Engineering - linux codesign in parallel (#246135)
* Set up the jobs and tasks * Add codesign script * Debug things * Speed things up while testing * Add more logging * More debugging * Try to use powershell * Another try * Another try * Remove debugging code * Remove debugging code * . * Try using pwsh * Fix script * Maybe now * Maybe now * Run the sign tasks in parallel * Revert debug change
This commit is contained in:
53
build/azure-pipelines/linux/codesign.ts
Normal file
53
build/azure-pipelines/linux/codesign.ts
Normal file
@@ -0,0 +1,53 @@
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import { $, ProcessPromise } from 'zx';
|
||||
import { e } from '../common/publish';
|
||||
|
||||
function printBanner(title: string) {
|
||||
title = `${title} (${new Date().toISOString()})`;
|
||||
|
||||
console.log('\n');
|
||||
console.log('#'.repeat(75));
|
||||
console.log(`# ${title.padEnd(71)} #`);
|
||||
console.log('#'.repeat(75));
|
||||
console.log('\n');
|
||||
}
|
||||
|
||||
async function handleProcessPromise(name: string, promise: ProcessPromise): Promise<void> {
|
||||
const result = await promise.pipe(process.stdout);
|
||||
if (!result.ok) {
|
||||
throw new Error(`${name} failed: ${result.stderr}`);
|
||||
}
|
||||
}
|
||||
|
||||
function sign(esrpCliDLLPath: string, type: 'sign-pgp', folder: string, glob: string): ProcessPromise {
|
||||
return $`node build/azure-pipelines/common/sign ${esrpCliDLLPath} ${type} ${folder} ${glob}`;
|
||||
}
|
||||
|
||||
async function main() {
|
||||
const esrpCliDLLPath = e('EsrpCliDllPath');
|
||||
|
||||
// Start the code sign processes in parallel
|
||||
// 1. Codesign deb package
|
||||
// 2. Codesign rpm package
|
||||
const codesignTask1 = sign(esrpCliDLLPath, 'sign-pgp', '.build/linux/deb', '*.deb');
|
||||
const codesignTask2 = sign(esrpCliDLLPath, 'sign-pgp', '.build/linux/rpm', '*.rpm');
|
||||
|
||||
// Codesign deb package
|
||||
printBanner('Codesign deb package');
|
||||
await handleProcessPromise('Codesign deb package', codesignTask1);
|
||||
|
||||
// Codesign rpm package
|
||||
printBanner('Codesign rpm package');
|
||||
await handleProcessPromise('Codesign rpm package', codesignTask2);
|
||||
}
|
||||
|
||||
main().then(() => {
|
||||
process.exit(0);
|
||||
}, err => {
|
||||
console.error(err);
|
||||
process.exit(1);
|
||||
});
|
||||
Reference in New Issue
Block a user