From d9ad1cac33efcd34033315b14f1fdc5243e902e3 Mon Sep 17 00:00:00 2001 From: Wes Haggard Date: Fri, 29 Jan 2021 13:04:29 -0800 Subject: [PATCH] Move global variable to the pipeline level (#18288) To ensure we always include the global variables in all our pipeline jobs and stages we should import the variables at the highest pipeline level to ensure we don't miss setting these variables in any jobs. --- eng/pipelines/templates/jobs/archetype-sdk-client.yml | 6 ------ eng/pipelines/templates/jobs/archetype-sdk-tests-jobs.yml | 1 - eng/pipelines/templates/stages/archetype-sdk-client.yml | 3 +++ eng/pipelines/templates/stages/archetype-sdk-tests.yml | 2 ++ 4 files changed, 5 insertions(+), 7 deletions(-) diff --git a/eng/pipelines/templates/jobs/archetype-sdk-client.yml b/eng/pipelines/templates/jobs/archetype-sdk-client.yml index 5b69e49dbe3c9..b9a91d7fa4533 100644 --- a/eng/pipelines/templates/jobs/archetype-sdk-client.yml +++ b/eng/pipelines/templates/jobs/archetype-sdk-client.yml @@ -31,8 +31,6 @@ parameters: jobs: - job: Build - variables: - - template: ../variables/globals.yml pool: name: ${{ parameters.WindowsPool }} # Comment this line back-out to switch to public pools. # vmImage: windows-2019 # Comment this line back-in to switch to public pools. @@ -97,8 +95,6 @@ jobs: - job: "Analyze" condition: and(succeededOrFailed(), ne(variables['Skip.Analyze'], true)) - variables: - - template: ../variables/globals.yml pool: name: ${{ parameters.LinuxPool }} vmImage: @@ -151,8 +147,6 @@ jobs: - job: "Test" timeoutInMinutes: ${{ parameters.TestTimeoutInMinutes }} condition: and(succeededOrFailed(), ne(variables['Skip.Test'], true)) - variables: - - template: ../variables/globals.yml strategy: maxParallel: $[ variables['MaxParallelTestJobs'] ] matrix: diff --git a/eng/pipelines/templates/jobs/archetype-sdk-tests-jobs.yml b/eng/pipelines/templates/jobs/archetype-sdk-tests-jobs.yml index 2e6ac7a170ab8..90bd131572478 100644 --- a/eng/pipelines/templates/jobs/archetype-sdk-tests-jobs.yml +++ b/eng/pipelines/templates/jobs/archetype-sdk-tests-jobs.yml @@ -53,7 +53,6 @@ jobs: matrix: $[ ${{ parameters.Matrix }} ] variables: - - template: ../variables/globals.yml # ServiceDirectory references must get passed down by the caller as variable references - name: ServiceDirectory value: ${{ parameters.ServiceDirectory }} diff --git a/eng/pipelines/templates/stages/archetype-sdk-client.yml b/eng/pipelines/templates/stages/archetype-sdk-client.yml index ed875c07748b8..894ae0b4e7f3d 100644 --- a/eng/pipelines/templates/stages/archetype-sdk-client.yml +++ b/eng/pipelines/templates/stages/archetype-sdk-client.yml @@ -43,6 +43,9 @@ parameters: type: number default: 60 +variables: + - template: ../variables/globals.yml + stages: - stage: Build jobs: diff --git a/eng/pipelines/templates/stages/archetype-sdk-tests.yml b/eng/pipelines/templates/stages/archetype-sdk-tests.yml index 2dc849001bad0..d1c10cff97e09 100644 --- a/eng/pipelines/templates/stages/archetype-sdk-tests.yml +++ b/eng/pipelines/templates/stages/archetype-sdk-tests.yml @@ -85,6 +85,8 @@ parameters: pathToPublish: '$(Build.ArtifactStagingDirectory)/SessionRecords' artifactName: SessionRecords +variables: + - template: ../variables/globals.yml stages: - ${{ each cloud in parameters.CloudConfig }}: