diff --git a/.pipelines/.vsts-vhd-builder-release-windows.yaml b/.pipelines/.vsts-vhd-builder-release-windows.yaml index a70c7d28f65..159a6a14e21 100644 --- a/.pipelines/.vsts-vhd-builder-release-windows.yaml +++ b/.pipelines/.vsts-vhd-builder-release-windows.yaml @@ -24,9 +24,6 @@ pr: exclude: - vhdbuilder/release-notes -pool: - name: $(AZURE_POOL_NAME) - parameters: - name: build2019containerd displayName: Build 2019 containerd @@ -69,6 +66,9 @@ variables: SUBSCRIPTION_ID: $(AZURE_PROD_SUBSCRIPTION_ID) SKIP_E2E_TESTS: $(PIPELINE_SKIP_E2E_TESTS) +pool: + name: $(AZURE_POOL_NAME) + # Use variable group "ab-windows-ame-tenant" and link it to the pipeline "AKS Windows VHD Build" # Use variable group "ab-windows-ame-tenant" and link it to the pipeline "AKS Windows VHD Build - PR check-in gate" # Use variable group "ab-windows-ms-tenant" and link it to the pipeline "[TEST All VHDs] AKS Windows VHD Build - Msft Tenant" @@ -84,6 +84,8 @@ stages: build: ${{ parameters.build2019containerd }} vhddebug: ${{ parameters.vhddebug }} dryrun: ${{ parameters.dryrun }} + subscriptionId: $(AZURE_PROD_SUBSCRIPTION_ID) + poolName: $(AZURE_POOL_NAME) - template: ./templates/.build-and-test-windows-vhd-template.yaml parameters: @@ -95,6 +97,8 @@ stages: build: ${{ parameters.build2022containerd }} vhddebug: ${{ parameters.vhddebug }} dryrun: ${{ parameters.dryrun }} + subscriptionId: $(AZURE_PROD_SUBSCRIPTION_ID) + poolName: $(AZURE_POOL_NAME) - template: ./templates/.build-and-test-windows-vhd-template.yaml parameters: @@ -106,6 +110,8 @@ stages: build: ${{ parameters.build2022containerdgen2 }} vhddebug: ${{ parameters.vhddebug }} dryrun: ${{ parameters.dryrun }} + subscriptionId: $(AZURE_PROD_SUBSCRIPTION_ID) + poolName: $(AZURE_POOL_NAME) - template: ./templates/.build-and-test-windows-vhd-template.yaml parameters: @@ -117,6 +123,8 @@ stages: build: ${{ parameters.build23H2 }} vhddebug: ${{ parameters.vhddebug }} dryrun: ${{ parameters.dryrun }} + subscriptionId: $(AZURE_PROD_SUBSCRIPTION_ID) + poolName: $(AZURE_POOL_NAME) - template: ./templates/.build-and-test-windows-vhd-template.yaml parameters: @@ -128,6 +136,8 @@ stages: build: ${{ parameters.build23H2gen2 }} vhddebug: ${{ parameters.vhddebug }} dryrun: ${{ parameters.dryrun }} + subscriptionId: $(AZURE_PROD_SUBSCRIPTION_ID) + poolName: $(AZURE_POOL_NAME) - stage: backfill_cleanup_outdated_resources dependsOn: [] diff --git a/.pipelines/.vsts-vhd-builder-release.yaml b/.pipelines/.vsts-vhd-builder-release.yaml index d85d38077f8..092b2d2efa6 100644 --- a/.pipelines/.vsts-vhd-builder-release.yaml +++ b/.pipelines/.vsts-vhd-builder-release.yaml @@ -1272,3 +1272,6 @@ stages: TAGS_TO_SKIP: "os=windows" jobs: - template: ./templates/e2e-template.yaml + parameters: + subscriptionId: $(SUBSCRIPTION_ID) + poolName: $(POOL_NAME) diff --git a/.pipelines/.vsts-vhd-builder.yaml b/.pipelines/.vsts-vhd-builder.yaml index 7b4ba2f643d..6a863499f6e 100644 --- a/.pipelines/.vsts-vhd-builder.yaml +++ b/.pipelines/.vsts-vhd-builder.yaml @@ -81,4 +81,7 @@ stages: VHD_BUILD_ID: $(Build.BuildId) jobs: - template: ./templates/e2e-template.yaml + parameters: + subscriptionId: $(SUBSCRIPTION_ID) + poolName: $(POOL_NAME) diff --git a/.pipelines/e2e-windows.yaml b/.pipelines/e2e-windows.yaml index 6d894669905..bab8053f187 100644 --- a/.pipelines/e2e-windows.yaml +++ b/.pipelines/e2e-windows.yaml @@ -29,3 +29,6 @@ pr: - staging/cse/windows/README jobs: - template: ./templates/e2e-template.yaml + parameters: + subscriptionId: $(SUBSCRIPTION_ID) + poolName: $(POOL_NAME) diff --git a/.pipelines/e2e.yaml b/.pipelines/e2e.yaml index ba60af0c71c..fe6bc11ed6e 100644 --- a/.pipelines/e2e.yaml +++ b/.pipelines/e2e.yaml @@ -28,3 +28,6 @@ pr: - staging/cse/windows/README jobs: - template: ./templates/e2e-template.yaml + parameters: + subscriptionId: $(SUBSCRIPTION_ID) + poolName: $(POOL_NAME) diff --git a/.pipelines/templates/.build-and-test-windows-vhd-template.yaml b/.pipelines/templates/.build-and-test-windows-vhd-template.yaml index 0ca904d6d6d..d583bf63ba7 100644 --- a/.pipelines/templates/.build-and-test-windows-vhd-template.yaml +++ b/.pipelines/templates/.build-and-test-windows-vhd-template.yaml @@ -30,6 +30,10 @@ parameters: - name: hyperVGeneration type: string displayName: V1 or V2. + - name: subscriptionId + type: string + - name: poolName + type: string stages: - stage: build_${{ parameters.stageName }} @@ -40,6 +44,9 @@ stages: condition: eq('${{ parameters.build }}', True) timeoutInMinutes: 180 steps: + - bash: | + echo "Subscription ID: ${{ parameters.subscriptionId }}" + echo "Pool Name: ${{ parameters.poolName }}" - bash: | echo '##vso[task.setvariable variable=VHD_DEBUG]${{ parameters.vhddebug }}' echo '##vso[task.setvariable variable=DRY_RUN]${{ parameters.dryrun }}' @@ -59,6 +66,9 @@ stages: dependsOn: build_${{ parameters.stageName }} variables: TAGS_TO_RUN: imageName=${{ parameters.imageName }} - POOL_NAME: $(AZURE_POOL_NAME) + POOL_NAME: ${{ parameters.poolName }} jobs: - template: ./e2e-template.yaml + parameters: + - subscriptionId: ${{ parameters.subscriptionId }} + - poolName: ${{ parameters.poolName }} diff --git a/.pipelines/templates/e2e-template.yaml b/.pipelines/templates/e2e-template.yaml index b0e7d24ecb8..35adef284d5 100644 --- a/.pipelines/templates/e2e-template.yaml +++ b/.pipelines/templates/e2e-template.yaml @@ -1,17 +1,27 @@ +parameters: + - name: subscriptionId + type: string + - name: poolName + type: string + jobs: - job: e2e condition: and(succeeded(), ne(variables.SKIP_E2E_TESTS, 'true')) pool: - name: $(POOL_NAME) + name: ${{ parameters.poolName }} timeoutInMinutes: 90 displayName: Run AgentBaker E2E variables: - group: ab-e2e steps: + - bash: | + echo "Subscription ID: ${{ parameters.subscriptionId }}" + echo "Pool Name: ${{ parameters.poolName }}" + displayName: Echo Vars - bash: | set -ex az login --identity - az account set -s $(SUBSCRIPTION_ID) + az account set -s ${{ parameters.subscriptionId }} displayName: Azure login - bash: bash .pipelines/scripts/setup_go.sh displayName: Setup go