Fixes build folder compilation + enable linux .deb files (#23006)

This commit is contained in:
Cheena Malhotra
2023-05-08 13:40:53 -07:00
committed by GitHub
parent 9415db87a2
commit ea39622e81
57 changed files with 1212 additions and 2101 deletions

View File

@@ -130,7 +130,6 @@ function getEnv(name) {
return result;
}
async function main() {
var _a;
const [, , product, os, arch, unprocessedType, fileName, filePath] = process.argv;
// getPlatform needs the unprocessedType
const platform = getPlatform(product, os, arch, unprocessedType);
@@ -169,7 +168,7 @@ async function main() {
console.log('Blob successfully uploaded to Azure storage.');
})
];
const shouldUploadToMooncake = /true/i.test((_a = process.env['VSCODE_PUBLISH_TO_MOONCAKE']) !== null && _a !== void 0 ? _a : 'true');
const shouldUploadToMooncake = /true/i.test(process.env['VSCODE_PUBLISH_TO_MOONCAKE'] ?? 'true');
if (shouldUploadToMooncake) {
const mooncakeCredential = new identity_1.ClientSecretCredential(process.env['AZURE_MOONCAKE_TENANT_ID'], process.env['AZURE_MOONCAKE_CLIENT_ID'], process.env['AZURE_MOONCAKE_CLIENT_SECRET']);
const mooncakeBlobServiceClient = new storage_blob_1.BlobServiceClient(`https://vscode.blob.core.chinacloudapi.cn`, mooncakeCredential, storagePipelineOptions);

View File

@@ -19,12 +19,11 @@ function getEnv(name) {
return result;
}
async function main() {
var _a, _b, _c;
const [, , _version] = process.argv;
const quality = getEnv('VSCODE_QUALITY');
const commit = ((_a = process.env['VSCODE_DISTRO_COMMIT']) === null || _a === void 0 ? void 0 : _a.trim()) || getEnv('BUILD_SOURCEVERSION');
const commit = process.env['VSCODE_DISTRO_COMMIT']?.trim() || getEnv('BUILD_SOURCEVERSION');
const queuedBy = getEnv('BUILD_QUEUEDBY');
const sourceBranch = ((_b = process.env['VSCODE_DISTRO_REF']) === null || _b === void 0 ? void 0 : _b.trim()) || getEnv('BUILD_SOURCEBRANCH');
const sourceBranch = process.env['VSCODE_DISTRO_REF']?.trim() || getEnv('BUILD_SOURCEBRANCH');
const version = _version + (quality === 'stable' ? '' : `-${quality}`);
console.log('Creating build...');
console.log('Quality:', quality);
@@ -35,7 +34,7 @@ async function main() {
timestamp: (new Date()).getTime(),
version,
isReleased: false,
private: Boolean((_c = process.env['VSCODE_DISTRO_REF']) === null || _c === void 0 ? void 0 : _c.trim()),
private: Boolean(process.env['VSCODE_DISTRO_REF']?.trim()),
sourceBranch,
queuedBy,
assets: [],
@@ -44,7 +43,7 @@ async function main() {
const aadCredentials = new identity_1.ClientSecretCredential(process.env['AZURE_TENANT_ID'], process.env['AZURE_CLIENT_ID'], process.env['AZURE_CLIENT_SECRET']);
const client = new cosmos_1.CosmosClient({ endpoint: process.env['AZURE_DOCUMENTDB_ENDPOINT'], aadCredentials });
const scripts = client.database('builds').container(quality).scripts;
await (0, retry_1.retry)(() => scripts.storedProcedure('createBuild').execute('', [Object.assign(Object.assign({}, build), { _partitionKey: '' })]));
await (0, retry_1.retry)(() => scripts.storedProcedure('createBuild').execute('', [{ ...build, _partitionKey: '' }]));
}
main().then(() => {
console.log('Build successfully created');

View File

@@ -109,7 +109,6 @@ async function assertContainer(containerClient) {
return containerResponse && !!containerResponse.errorCode;
}
async function uploadBlob(blobClient, file) {
var _a, _b;
const result = await blobClient.uploadFile(file, {
blobHTTPHeaders: {
blobContentType: mime.lookup(file),
@@ -117,10 +116,10 @@ async function uploadBlob(blobClient, file) {
}
});
if (result && !result.errorCode) {
console.log(`Blobs uploaded successfully, response status: ${(_a = result === null || result === void 0 ? void 0 : result._response) === null || _a === void 0 ? void 0 : _a.status}`);
console.log(`Blobs uploaded successfully, response status: ${result?._response?.status}`);
}
else {
console.error(`Blobs failed to upload, response status: ${(_b = result === null || result === void 0 ? void 0 : result._response) === null || _b === void 0 ? void 0 : _b.status}, errorcode: ${result === null || result === void 0 ? void 0 : result.errorCode}`);
console.error(`Blobs failed to upload, response status: ${result?._response?.status}, errorcode: ${result?.errorCode}`);
}
}
async function publish(commit, quality, platform, type, name, version, _isUpdate, file, opts) {

View File

@@ -180,12 +180,11 @@ steps:
# continueOnError: true
# condition: and(succeeded(), eq(variables['RUN_TESTS'], 'true'))
# {{SQL CARBON TODO}} - Reenable
# - script: |
# set -e
# yarn gulp vscode-linux-x64-build-deb
# displayName: Build Deb
# condition: and(succeeded(), ne(variables['EXTENSIONS_ONLY'], 'true'))
- script: |
set -e
yarn gulp vscode-linux-x64-build-deb
displayName: Build Deb
condition: and(succeeded(), ne(variables['EXTENSIONS_ONLY'], 'true'))
- script: |
set -e

View File

@@ -27,16 +27,16 @@ If (-NOT ($Quality -eq "stable")) {
node $sourcesDir\build\azure-pipelines\common\publish.js $Quality $PlatformLinux archive-unsigned "$TarballUploadName.tar.gz" $Version true $TarballPath $CommitId
# Publish DEB
# $PlatformDeb = "linux-deb-$Arch"
# $DebFilename = "$(Get-ChildItem -File -Name $artifactsDir\linux\deb\amd64\deb\*.deb)"
# $DebPath = "$artifactsDir\linux\deb\amd64\deb\$DebFilename"
# $DebUploadName = "azuredatastudio-linux-$Version"
$PlatformDeb = "linux-deb-$Arch"
$DebFilename = "$(Get-ChildItem -File -Name $artifactsDir\linux\deb\amd64\deb\*.deb)"
$DebPath = "$artifactsDir\linux\deb\amd64\deb\$DebFilename"
$DebUploadName = "azuredatastudio-linux-$Version"
# If (-NOT ($Quality -eq "stable")) {
# $DebUploadName = "$DebUploadName-$Quality"
# }
If (-NOT ($Quality -eq "stable")) {
$DebUploadName = "$DebUploadName-$Quality"
}
# node $sourcesDir\build\azure-pipelines\common\publish.js $Quality $PlatformDeb package "$DebUploadName.deb" $Version true $DebPath $CommitId
node $sourcesDir\build\azure-pipelines\common\publish.js $Quality $PlatformDeb package "$DebUploadName.deb" $Version true $DebPath $CommitId
# Publish RPM
$PlatformRpm = "linux-rpm-$Arch"

View File

@@ -43,7 +43,7 @@ async function mixinClient(quality) {
else {
fancyLog(ansiColors.blue('[mixin]'), 'Inheriting OSS built-in extensions', builtInExtensions.map(e => e.name));
}
return Object.assign(Object.assign({ webBuiltInExtensions: originalProduct.webBuiltInExtensions }, o), { builtInExtensions });
return { webBuiltInExtensions: originalProduct.webBuiltInExtensions, ...o, builtInExtensions };
}))
.pipe(productJsonFilter.restore)
.pipe(es.mapSync((f) => {
@@ -64,7 +64,7 @@ function mixinServer(quality) {
fancyLog(ansiColors.blue('[mixin]'), `Mixing in server:`);
const originalProduct = JSON.parse(fs.readFileSync(path.join(__dirname, '..', '..', 'product.json'), 'utf8'));
const serverProductJson = JSON.parse(fs.readFileSync(serverProductJsonPath, 'utf8'));
fs.writeFileSync('product.json', JSON.stringify(Object.assign(Object.assign({}, originalProduct), serverProductJson), undefined, '\t'));
fs.writeFileSync('product.json', JSON.stringify({ ...originalProduct, ...serverProductJson }, undefined, '\t'));
fancyLog(ansiColors.blue('[mixin]'), 'product.json', ansiColors.green('✔︎'));
}
function main() {