From b7f22b03477ff0a692b30d32e7b75610260e4b8f Mon Sep 17 00:00:00 2001 From: Dmitrii Bobreshev <106314398+DmitriiBobreshev@users.noreply.github.com> Date: Mon, 20 Nov 2023 07:07:10 -0800 Subject: [PATCH] Pass tasks to "build all tasks for deployment" job (#19306) * - Pass tasks which was built in courtesy to the next job * - Changed passed variable * - Uncommited cpurtesz push and publish jobs --- azure-pipelines.yml | 3 +++ ci/build-all-steps.yml | 7 ++++--- ci/build-all-tasks.yml | 2 +- ci/filter-tasks.js | 2 +- 4 files changed, 9 insertions(+), 5 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 2e31057583e2..36855be98a90 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -101,8 +101,11 @@ jobs: displayName: Build all tasks for deployments (Windows) dependsOn: - courtesy_push + - build_all_windows condition: succeeded() timeoutInMinutes: 180 + variables: + task_pattern: $[dependencies.build_all_windows.outputs['getTaskPattern.task_pattern']] pool: name: 1ES-Shared-Hosted-Pool_Windows-Server-2022 steps: diff --git a/ci/build-all-steps.yml b/ci/build-all-steps.yml index 352733edcac9..f13078c79067 100644 --- a/ci/build-all-steps.yml +++ b/ci/build-all-steps.yml @@ -51,6 +51,7 @@ steps: # Filter out unchanged tasks - script: node ./ci/filter-tasks.js displayName: Filter out unchanged tasks + name: getTaskPattern env: PACKAGE_ENDPOINT: $(Package.Endpoint) PACKAGE_TOKEN: $(Package.Token) @@ -89,7 +90,7 @@ steps: displayName: Clean tasks # Build Tasks -- script: node make.js serverBuild --task "$(task_pattern)" +- script: node make.js serverBuild --task "$(getTaskPattern.task_pattern)" displayName: Build Tasks condition: and(succeeded(), ne(variables['numTasks'], 0)) @@ -103,7 +104,7 @@ steps: ) # Check diff for task sources -- script: node ./ci/verify-source-changes.js "$(task_pattern)" +- script: node ./ci/verify-source-changes.js "$(getTaskPattern.task_pattern)" displayName: Verify task source changes condition: | and( @@ -159,7 +160,7 @@ steps: - script: node make.js test displayName: Run tests condition: and(succeeded(), ne(variables['numTasks'], 0)) -- script: node make.js testLegacy --task "$(task_pattern)" +- script: node make.js testLegacy --task "$(getTaskPattern.task_pattern)" displayName: Legacy tests with node 6 condition: and(succeeded(), ne(variables['numTasks'], 0)) diff --git a/ci/build-all-tasks.yml b/ci/build-all-tasks.yml index 5660681198fb..4a3f46caa433 100644 --- a/ci/build-all-tasks.yml +++ b/ci/build-all-tasks.yml @@ -21,7 +21,7 @@ steps: displayName: Clean tasks # Build tasks -- script: node make.js serverBuild +- script: node make.js serverBuild --task "$(task_pattern)" displayName: Build tasks # Stage tasks individually into the package directory diff --git a/ci/filter-tasks.js b/ci/filter-tasks.js index 12bacf6e11a9..bbfd50f17b27 100644 --- a/ci/filter-tasks.js +++ b/ci/filter-tasks.js @@ -213,7 +213,7 @@ async function getTasksToBuildForPR (prId, forDowngradingCheck) { var setTaskVariables = function(tasks, tasksForDowngradingCheck) { console.log('tasks: ' + JSON.stringify(tasks)); console.log('tasksForDowngradingCheck: ' + JSON.stringify(tasksForDowngradingCheck)); - console.log('##vso[task.setVariable variable=task_pattern]@(' + tasks.join('|') + ')'); + console.log('##vso[task.setVariable variable=task_pattern;isOutput=true;]@(' + tasks.join('|') + ')'); console.log('##vso[task.setVariable variable=task_pattern_fordowngradingcheck]@(' + tasksForDowngradingCheck.join('|') + ')'); console.log('##vso[task.setVariable variable=numTasks]' + tasks.length); }