From 0991720b7b44ffc15760b578b284caff78ccf398 Mon Sep 17 00:00:00 2001 From: Logan Ramos Date: Wed, 3 Jul 2019 10:12:23 -0700 Subject: [PATCH] Build Improvements for Telemetry Command (#76431) * Update telemetry tooling commit * Extract telemetry build to helper script * Fix file permissions * Script fixes * Update telemetry commit * Update telemetry tool commit * Wrap commands in Exec * Fix some execs * Fixed typo * Update commit --- build/azure-pipelines/common/extract-telemetry.sh | 14 ++++++++++++++ .../darwin/product-build-darwin.yml | 12 +----------- .../azure-pipelines/linux/product-build-linux.yml | 12 +----------- .../azure-pipelines/win32/product-build-win32.yml | 12 ++++++------ 4 files changed, 22 insertions(+), 28 deletions(-) create mode 100755 build/azure-pipelines/common/extract-telemetry.sh diff --git a/build/azure-pipelines/common/extract-telemetry.sh b/build/azure-pipelines/common/extract-telemetry.sh new file mode 100755 index 00000000000..f07721cc5c1 --- /dev/null +++ b/build/azure-pipelines/common/extract-telemetry.sh @@ -0,0 +1,14 @@ +#!/usr/bin/env bash +set -e + +cd $BUILD_STAGINGDIRECTORY +git clone https://github.com/microsoft/vscode-telemetry-extractor.git +cd vscode-telemetry-extractor +git checkout f538e3157c84d1bd0b239dfc5ebccac226006d58 +npm i +npm run setup-extension-repos +node ./out/cli-extract.js --sourceDir $BUILD_SOURCESDIRECTORY --excludedDirPattern extensions --outputDir . --applyEndpoints --includeIsMeasurement --patchWebsiteEvents +node ./out/cli-extract-extensions.js --sourceDir ./src/telemetry-sources --outputDir . --applyEndpoints --includeIsMeasurement +mkdir -p $BUILD_SOURCESDIRECTORY/.build/telemetry +mv declarations-resolved.json $BUILD_SOURCESDIRECTORY/.build/telemetry/telemetry-core.json +mv declarations-extensions-resolved.json $BUILD_SOURCESDIRECTORY/.build/telemetry/telemetry-extensions.json \ No newline at end of file diff --git a/build/azure-pipelines/darwin/product-build-darwin.yml b/build/azure-pipelines/darwin/product-build-darwin.yml index 4b747443cc1..13691851e5b 100644 --- a/build/azure-pipelines/darwin/product-build-darwin.yml +++ b/build/azure-pipelines/darwin/product-build-darwin.yml @@ -81,17 +81,7 @@ steps: - script: | set -e - cd $BUILD_STAGINGDIRECTORY - git clone https://github.com/microsoft/vscode-telemetry-extractor.git - cd vscode-telemetry-extractor - git checkout 3b04aba5bfdfcca1a5426cd2c51a90d18740d0bc - npm i - npm run setup-extension-repos - node ./out/cli-extract.js --sourceDir $BUILD_SOURCESDIRECTORY --excludedDirPattern extensions --outputDir . --applyEndpoints --includeIsMeasurement --patchWebsiteEvents - node ./out/cli-extract-extensions.js --sourceDir ./src/telemetry-sources --outputDir . --applyEndpoints --includeIsMeasurement - mkdir -p $BUILD_SOURCESDIRECTORY/.build/telemetry - mv declarations-resolved.json $BUILD_SOURCESDIRECTORY/.build/telemetry/telemetry-core.json - mv declarations-extensions-resolved.json $BUILD_SOURCESDIRECTORY/.build/telemetry/telemetry-extensions.json + ./build/azure-pipelines/common/extract-telemetry.sh displayName: Extract Telemetry - script: | diff --git a/build/azure-pipelines/linux/product-build-linux.yml b/build/azure-pipelines/linux/product-build-linux.yml index f6887313aef..9322cd15a45 100644 --- a/build/azure-pipelines/linux/product-build-linux.yml +++ b/build/azure-pipelines/linux/product-build-linux.yml @@ -82,17 +82,7 @@ steps: - script: | set -e - cd $BUILD_STAGINGDIRECTORY - git clone https://github.com/microsoft/vscode-telemetry-extractor.git - cd vscode-telemetry-extractor - git checkout 3b04aba5bfdfcca1a5426cd2c51a90d18740d0bc - npm i - npm run setup-extension-repos - node ./out/cli-extract.js --sourceDir $BUILD_SOURCESDIRECTORY --excludedDirPattern extensions --outputDir . --applyEndpoints --includeIsMeasurement --patchWebsiteEvents - node ./out/cli-extract-extensions.js --sourceDir ./src/telemetry-sources --outputDir . --applyEndpoints --includeIsMeasurement - mkdir -p $BUILD_SOURCESDIRECTORY/.build/telemetry - mv declarations-resolved.json $BUILD_SOURCESDIRECTORY/.build/telemetry/telemetry-core.json - mv declarations-extensions-resolved.json $BUILD_SOURCESDIRECTORY/.build/telemetry/telemetry-extensions.json + ./build/azure-pipelines/common/extract-telemetry.sh displayName: Extract Telemetry - script: | diff --git a/build/azure-pipelines/win32/product-build-win32.yml b/build/azure-pipelines/win32/product-build-win32.yml index 799599251a8..e6f663f0e31 100644 --- a/build/azure-pipelines/win32/product-build-win32.yml +++ b/build/azure-pipelines/win32/product-build-win32.yml @@ -93,13 +93,13 @@ steps: . build/azure-pipelines/win32/exec.ps1 $ErrorActionPreference = "Stop" cd $env:BUILD_STAGINGDIRECTORY - git clone https://github.com/microsoft/vscode-telemetry-extractor.git + exec { git clone https://github.com/microsoft/vscode-telemetry-extractor.git } cd vscode-telemetry-extractor - git checkout 3b04aba5bfdfcca1a5426cd2c51a90d18740d0bc - npm i - npm run setup-extension-repos - node .\out\cli-extract.js --sourceDir $env:BUILD_SOURCESDIRECTORY --excludedDirPattern extensions --outputDir . --applyEndpoints --includeIsMeasurement --patchWebsiteEvents - node .\out\cli-extract-extensions.js --sourceDir .\src\telemetry-sources --outputDir . --applyEndpoints --includeIsMeasurement + exec { git checkout f538e3157c84d1bd0b239dfc5ebccac226006d58 } + exec { npm i } + exec { npm run setup-extension-repos } + exec { node .\out\cli-extract.js --sourceDir $env:BUILD_SOURCESDIRECTORY --excludedDirPattern extensions --outputDir . --applyEndpoints --includeIsMeasurement --patchWebsiteEvents } + exec { node .\out\cli-extract-extensions.js --sourceDir .\src\telemetry-sources --outputDir . --applyEndpoints --includeIsMeasurement } mkdir $env:BUILD_SOURCESDIRECTORY\.build\telemetry -ea 0 mv declarations-resolved.json $env:BUILD_SOURCESDIRECTORY\.build\telemetry\telemetry-core.json mv declarations-extensions-resolved.json $env:BUILD_SOURCESDIRECTORY\.build\telemetry\telemetry-extensions.json -- GitLab