Skip to content

Commit

Permalink
pass subscription id and pool name explicitly
Browse files Browse the repository at this point in the history
  • Loading branch information
timmy-wright committed Jan 17, 2025
1 parent 5f2fb2b commit 5167a56
Showing 7 changed files with 48 additions and 6 deletions.
16 changes: 13 additions & 3 deletions .pipelines/.vsts-vhd-builder-release-windows.yaml
Original file line number Diff line number Diff line change
@@ -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: []
3 changes: 3 additions & 0 deletions .pipelines/.vsts-vhd-builder-release.yaml
Original file line number Diff line number Diff line change
@@ -1272,3 +1272,6 @@ stages:
TAGS_TO_SKIP: "os=windows"
jobs:
- template: ./templates/e2e-template.yaml
parameters:
subscriptionId: $(SUBSCRIPTION_ID)
poolName: $(POOL_NAME)
3 changes: 3 additions & 0 deletions .pipelines/.vsts-vhd-builder.yaml
Original file line number Diff line number Diff line change
@@ -81,4 +81,7 @@ stages:
VHD_BUILD_ID: $(Build.BuildId)
jobs:
- template: ./templates/e2e-template.yaml
parameters:
subscriptionId: $(SUBSCRIPTION_ID)
poolName: $(POOL_NAME)

3 changes: 3 additions & 0 deletions .pipelines/e2e-windows.yaml
Original file line number Diff line number Diff line change
@@ -29,3 +29,6 @@ pr:
- staging/cse/windows/README
jobs:
- template: ./templates/e2e-template.yaml
parameters:
subscriptionId: $(SUBSCRIPTION_ID)
poolName: $(POOL_NAME)
3 changes: 3 additions & 0 deletions .pipelines/e2e.yaml
Original file line number Diff line number Diff line change
@@ -28,3 +28,6 @@ pr:
- staging/cse/windows/README
jobs:
- template: ./templates/e2e-template.yaml
parameters:
subscriptionId: $(SUBSCRIPTION_ID)
poolName: $(POOL_NAME)
12 changes: 11 additions & 1 deletion .pipelines/templates/.build-and-test-windows-vhd-template.yaml
Original file line number Diff line number Diff line change
@@ -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 }}
14 changes: 12 additions & 2 deletions .pipelines/templates/e2e-template.yaml
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 5167a56

Please sign in to comment.