Create ARM assets in product build (#74787)

This commit is contained in:
João Moreno 2019-06-03 14:33:59 +02:00 committed by GitHub
parent 038f5638ec
commit 52b33bfafd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
13 changed files with 135 additions and 29 deletions

View file

@ -1,20 +0,0 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. 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);
});

View file

@ -0,0 +1,38 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. 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();

View file

@ -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

View file

@ -0,0 +1,3 @@
#!/usr/bin/env bash
set -e
echo 'noop'

View file

@ -0,0 +1,3 @@
#!/usr/bin/env bash
set -e
echo 'noop'

View 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

View file

@ -38,7 +38,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

View file

@ -0,0 +1,3 @@
#!/usr/bin/env bash
set -e
echo 'noop'

View file

@ -1,11 +1,11 @@
resources:
containers:
- container: vscode-x64
endpoint: VSCodeHub
image: vscodehub.azurecr.io/vscode-linux-build-agent:x64
- container: vscode-ia32
endpoint: VSCodeHub
- container: vscode-ia32
image: vscodehub.azurecr.io/vscode-linux-build-agent:ia32
endpoint: VSCodeHub
- container: snapcraft
image: snapcore/snapcraft
@ -59,6 +59,15 @@ jobs:
steps:
- template: linux/product-build-linux.yml
- job: LinuxArmhf
condition: eq(variables['VSCODE_BUILD_LINUX_ARMHF'], 'true')
pool:
vmImage: 'Ubuntu-16.04'
variables:
VSCODE_ARCH: armhf
steps:
- template: linux/product-build-linux-arm.yml
- job: macOS
condition: eq(variables['VSCODE_BUILD_MACOS'], 'true')
pool:
@ -76,6 +85,7 @@ jobs:
- Linux
- LinuxSnap
- Linux32
- LinuxArmhf
- macOS
steps:
- template: sync-mooncake.yml

View file

@ -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

View file

@ -27,7 +27,8 @@ gulp.task('mixin', function () {
fancyLog(ansiColors.blue('[mixin]'), `Mixing in sources:`);
return vfs
.src(`quality/${quality}/**`, { base: `quality/${quality}` })
.pipe(filter(function (f) { return !f.isDirectory(); }))
.pipe(filter(f => !f.isDirectory()))
.pipe(filter(['**', '!**/package.json']))
.pipe(productJsonFilter)
.pipe(buffer())
.pipe(json(o => Object.assign({}, require('../product.json'), o)))

View file

@ -13,4 +13,4 @@ gulp.task('vscode-reh-win32-ia32-min', noop);
gulp.task('vscode-reh-win32-x64-min', noop);
gulp.task('vscode-reh-darwin-min', noop);
gulp.task('vscode-reh-linux-x64-min', noop);
gulp.task('vscode-reh-linux-arm-min', noop);
gulp.task('vscode-reh-linux-armhf-min', noop);

View file

@ -1,7 +1,7 @@
{
"name": "code-oss-dev",
"version": "1.36.0",
"distro": "de0264486d700ff59c0acbe0e76f271f078027d8",
"distro": "5813bb8f127b63e9ad582178d9164f1153611f7a",
"author": {
"name": "Microsoft Corporation"
},
@ -155,4 +155,4 @@
"windows-mutex": "0.2.1",
"windows-process-tree": "0.2.3"
}
}
}