mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 10:58:30 -05:00
Merge from vscode 81d7885dc2e9dc617e1522697a2966bc4025a45d (#5949)
* Merge from vscode 81d7885dc2e9dc617e1522697a2966bc4025a45d * Fix vs unit tests and hygiene issue * Fix strict null check issue
This commit is contained in:
@@ -1,20 +0,0 @@
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import * as cp from 'child_process';
|
||||
import * as path from 'path';
|
||||
|
||||
function yarnInstall(packageName: string): void {
|
||||
cp.execSync(`yarn add --no-lockfile ${packageName}`);
|
||||
cp.execSync(`yarn add --no-lockfile ${packageName}`, { cwd: path.join( process.cwd(), 'remote') });
|
||||
}
|
||||
|
||||
const product = require('../../../product.json');
|
||||
const dependencies = product.dependencies || {} as { [name: string]: string; };
|
||||
|
||||
Object.keys(dependencies).forEach(name => {
|
||||
const url = dependencies[name];
|
||||
yarnInstall(url);
|
||||
});
|
||||
38
build/azure-pipelines/common/installDistroDependencies.ts
Normal file
38
build/azure-pipelines/common/installDistroDependencies.ts
Normal file
@@ -0,0 +1,38 @@
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import * as cp from 'child_process';
|
||||
import * as path from 'path';
|
||||
import * as fs from 'fs';
|
||||
|
||||
function yarnInstall(packageName: string, cwd: string): void {
|
||||
console.log(`yarn add --no-lockfile ${packageName}`, cwd);
|
||||
cp.execSync(`yarn add --no-lockfile ${packageName}`, { cwd, stdio: 'inherit' });
|
||||
}
|
||||
|
||||
/**
|
||||
* Install additional dependencies listed on each quality `package.json` file.
|
||||
*/
|
||||
function main() {
|
||||
const quality = process.env['VSCODE_QUALITY'];
|
||||
|
||||
if (!quality) {
|
||||
throw new Error('Missing VSCODE_QUALITY, can\'t install distro');
|
||||
}
|
||||
|
||||
const rootPath = path.dirname(path.dirname(path.dirname(__dirname)));
|
||||
const qualityPath = path.join(rootPath, 'quality', quality);
|
||||
const packagePath = path.join(qualityPath, 'package.json');
|
||||
const pkg = JSON.parse(fs.readFileSync(packagePath, 'utf8'));
|
||||
const dependencies = pkg.dependencies || {} as { [name: string]: string; };
|
||||
|
||||
Object.keys(dependencies).forEach(name => {
|
||||
const url = dependencies[name];
|
||||
const cwd = process.argv.length < 3 ? process.cwd() : path.join(process.cwd(), process.argv[2]);
|
||||
yarnInstall(url, cwd);
|
||||
});
|
||||
}
|
||||
|
||||
main();
|
||||
@@ -36,7 +36,6 @@ export interface IVersionAccessor extends IApplicationAccessor {
|
||||
enum Platform {
|
||||
WIN_32 = 'win32-ia32',
|
||||
WIN_64 = 'win32-x64',
|
||||
LINUX_32 = 'linux-ia32',
|
||||
LINUX_64 = 'linux-x64',
|
||||
MAC_OS = 'darwin-x64'
|
||||
}
|
||||
@@ -191,7 +190,7 @@ if (process.platform === 'darwin') {
|
||||
} else if (process.platform === 'win32') {
|
||||
platform = is64 ? Platform.WIN_64 : Platform.WIN_32;
|
||||
} else {
|
||||
platform = is64 ? Platform.LINUX_64 : Platform.LINUX_32;
|
||||
platform = Platform.LINUX_64;
|
||||
}
|
||||
|
||||
// Create version and upload symbols in HockeyApp
|
||||
|
||||
@@ -34,7 +34,8 @@ steps:
|
||||
yarn gulp mixin
|
||||
yarn gulp hygiene
|
||||
yarn monaco-compile-check
|
||||
node build/azure-pipelines/common/installDistro.js
|
||||
node build/azure-pipelines/common/installDistroDependencies.js
|
||||
node build/azure-pipelines/common/installDistroDependencies.js remote
|
||||
node build/lib/builtInExtensions.js
|
||||
displayName: Prepare build
|
||||
|
||||
|
||||
3
build/azure-pipelines/linux/build-arm.sh
Executable file
3
build/azure-pipelines/linux/build-arm.sh
Executable file
@@ -0,0 +1,3 @@
|
||||
#!/usr/bin/env bash
|
||||
set -e
|
||||
echo 'noop'
|
||||
3
build/azure-pipelines/linux/prebuild-arm.sh
Executable file
3
build/azure-pipelines/linux/prebuild-arm.sh
Executable file
@@ -0,0 +1,3 @@
|
||||
#!/usr/bin/env bash
|
||||
set -e
|
||||
echo 'noop'
|
||||
65
build/azure-pipelines/linux/product-build-linux-arm.yml
Normal file
65
build/azure-pipelines/linux/product-build-linux-arm.yml
Normal file
@@ -0,0 +1,65 @@
|
||||
steps:
|
||||
- task: NodeTool@0
|
||||
inputs:
|
||||
versionSpec: "10.15.1"
|
||||
|
||||
- task: geeklearningio.gl-vsts-tasks-yarn.yarn-installer-task.YarnInstaller@2
|
||||
inputs:
|
||||
versionSpec: "1.10.1"
|
||||
|
||||
- task: AzureKeyVault@1
|
||||
displayName: 'Azure Key Vault: Get Secrets'
|
||||
inputs:
|
||||
azureSubscription: 'vscode-builds-subscription'
|
||||
KeyVaultName: vscode
|
||||
|
||||
- task: Docker@1
|
||||
displayName: 'Pull image'
|
||||
inputs:
|
||||
azureSubscriptionEndpoint: 'vscode-builds-subscription'
|
||||
azureContainerRegistry: vscodehub.azurecr.io
|
||||
command: 'Run an image'
|
||||
imageName: 'vscode-linux-build-agent:armhf'
|
||||
containerCommand: uname
|
||||
|
||||
- script: |
|
||||
set -e
|
||||
|
||||
cat << EOF > ~/.netrc
|
||||
machine monacotools.visualstudio.com
|
||||
password $(devops-pat)
|
||||
machine github.com
|
||||
login vscode
|
||||
password $(github-distro-mixin-password)
|
||||
EOF
|
||||
|
||||
git config user.email "vscode@microsoft.com"
|
||||
git config user.name "VSCode"
|
||||
git remote add distro "https://github.com/$(VSCODE_MIXIN_REPO).git"
|
||||
git fetch distro
|
||||
git merge $(node -p "require('./package.json').distro")
|
||||
|
||||
CHILD_CONCURRENCY=1 yarn
|
||||
yarn gulp mixin
|
||||
yarn gulp hygiene
|
||||
yarn monaco-compile-check
|
||||
./build/azure-pipelines/linux/prebuild-arm.sh
|
||||
displayName: Prepare build
|
||||
|
||||
- script: |
|
||||
set -e
|
||||
./build/azure-pipelines/linux/build-arm.sh
|
||||
displayName: Build
|
||||
|
||||
- script: |
|
||||
set -e
|
||||
AZURE_DOCUMENTDB_MASTERKEY="$(builds-docdb-key-readwrite)" \
|
||||
AZURE_STORAGE_ACCESS_KEY_2="$(vscode-storage-key)" \
|
||||
VSCODE_MIXIN_PASSWORD="$(github-distro-mixin-password)" \
|
||||
VSCODE_HOCKEYAPP_TOKEN="$(vscode-hockeyapp-token)" \
|
||||
./build/azure-pipelines/linux/publish-arm.sh
|
||||
displayName: Publish
|
||||
|
||||
- task: ms.vss-governance-buildtask.governance-build-task-component-detection.ComponentGovernanceComponentDetection@0
|
||||
displayName: 'Component Detection'
|
||||
continueOnError: true
|
||||
@@ -16,9 +16,6 @@ steps:
|
||||
- script: |
|
||||
set -e
|
||||
export npm_config_arch="$(VSCODE_ARCH)"
|
||||
if [[ "$(VSCODE_ARCH)" == "ia32" ]]; then
|
||||
export PKG_CONFIG_PATH="/usr/lib/i386-linux-gnu/pkgconfig"
|
||||
fi
|
||||
|
||||
cat << EOF > ~/.netrc
|
||||
machine monacotools.visualstudio.com
|
||||
@@ -38,7 +35,8 @@ steps:
|
||||
yarn gulp mixin
|
||||
yarn gulp hygiene
|
||||
yarn monaco-compile-check
|
||||
node build/azure-pipelines/common/installDistro.js
|
||||
node build/azure-pipelines/common/installDistroDependencies.js
|
||||
node build/azure-pipelines/common/installDistroDependencies.js remote
|
||||
node build/lib/builtInExtensions.js
|
||||
displayName: Prepare build
|
||||
|
||||
|
||||
3
build/azure-pipelines/linux/publish-arm.sh
Executable file
3
build/azure-pipelines/linux/publish-arm.sh
Executable file
@@ -0,0 +1,3 @@
|
||||
#!/usr/bin/env bash
|
||||
set -e
|
||||
echo 'noop'
|
||||
@@ -5,8 +5,6 @@ ROOT="$REPO/.."
|
||||
|
||||
# Publish tarball
|
||||
PLATFORM_LINUX="linux-$VSCODE_ARCH"
|
||||
[[ "$VSCODE_ARCH" == "ia32" ]] && DEB_ARCH="i386" || DEB_ARCH="amd64"
|
||||
[[ "$VSCODE_ARCH" == "ia32" ]] && RPM_ARCH="i386" || RPM_ARCH="x86_64"
|
||||
BUILDNAME="VSCode-$PLATFORM_LINUX"
|
||||
BUILD="$ROOT/$BUILDNAME"
|
||||
BUILD_VERSION="$(date +%s)"
|
||||
@@ -39,7 +37,7 @@ node build/azure-pipelines/common/symbols.js "$VSCODE_MIXIN_PASSWORD" "$VSCODE_H
|
||||
# Publish DEB
|
||||
yarn gulp "vscode-linux-$VSCODE_ARCH-build-deb"
|
||||
PLATFORM_DEB="linux-deb-$VSCODE_ARCH"
|
||||
[[ "$VSCODE_ARCH" == "ia32" ]] && DEB_ARCH="i386" || DEB_ARCH="amd64"
|
||||
DEB_ARCH="amd64"
|
||||
DEB_FILENAME="$(ls $REPO/.build/linux/deb/$DEB_ARCH/deb/)"
|
||||
DEB_PATH="$REPO/.build/linux/deb/$DEB_ARCH/deb/$DEB_FILENAME"
|
||||
|
||||
@@ -48,7 +46,7 @@ node build/azure-pipelines/common/publish.js "$VSCODE_QUALITY" "$PLATFORM_DEB" p
|
||||
# Publish RPM
|
||||
yarn gulp "vscode-linux-$VSCODE_ARCH-build-rpm"
|
||||
PLATFORM_RPM="linux-rpm-$VSCODE_ARCH"
|
||||
[[ "$VSCODE_ARCH" == "ia32" ]] && RPM_ARCH="i386" || RPM_ARCH="x86_64"
|
||||
RPM_ARCH="x86_64"
|
||||
RPM_FILENAME="$(ls $REPO/.build/linux/rpm/$RPM_ARCH/ | grep .rpm)"
|
||||
RPM_PATH="$REPO/.build/linux/rpm/$RPM_ARCH/$RPM_FILENAME"
|
||||
|
||||
|
||||
@@ -1,11 +1,8 @@
|
||||
resources:
|
||||
containers:
|
||||
- container: vscode-x64
|
||||
endpoint: VSCodeHub
|
||||
image: vscodehub.azurecr.io/vscode-linux-build-agent:x64
|
||||
- container: vscode-ia32
|
||||
endpoint: VSCodeHub
|
||||
image: vscodehub.azurecr.io/vscode-linux-build-agent:ia32
|
||||
- container: snapcraft
|
||||
image: snapcore/snapcraft
|
||||
|
||||
@@ -49,15 +46,14 @@ jobs:
|
||||
steps:
|
||||
- template: linux/snap-build-linux.yml
|
||||
|
||||
- job: Linux32
|
||||
condition: eq(variables['VSCODE_BUILD_LINUX_32BIT'], 'true')
|
||||
- job: LinuxArmhf
|
||||
condition: eq(variables['VSCODE_BUILD_LINUX_ARMHF'], 'true')
|
||||
pool:
|
||||
vmImage: 'Ubuntu-16.04'
|
||||
variables:
|
||||
VSCODE_ARCH: ia32
|
||||
container: vscode-ia32
|
||||
VSCODE_ARCH: armhf
|
||||
steps:
|
||||
- template: linux/product-build-linux.yml
|
||||
- template: linux/product-build-linux-arm.yml
|
||||
|
||||
- job: macOS
|
||||
condition: eq(variables['VSCODE_BUILD_MACOS'], 'true')
|
||||
@@ -75,7 +71,7 @@ jobs:
|
||||
- Windows32
|
||||
- Linux
|
||||
- LinuxSnap
|
||||
- Linux32
|
||||
- LinuxArmhf
|
||||
- macOS
|
||||
steps:
|
||||
- template: sync-mooncake.yml
|
||||
@@ -35,7 +35,8 @@ steps:
|
||||
exec { yarn gulp mixin }
|
||||
exec { yarn gulp hygiene }
|
||||
exec { yarn monaco-compile-check }
|
||||
exec { node build/azure-pipelines/common/installDistro.js }
|
||||
exec { node build/azure-pipelines/common/installDistroDependencies.js }
|
||||
exec { node build/azure-pipelines/common/installDistroDependencies.js remote }
|
||||
exec { node build/lib/builtInExtensions.js }
|
||||
displayName: Prepare build
|
||||
|
||||
|
||||
Reference in New Issue
Block a user