[ci] Use correct branch when downloading SONiC vs image in elastic test. (#17873)

Why I did it
Use dynamic variable for branch reference.

Work item tracking
Microsoft ADO (number only): 26563706
How I did it
How to verify it
This commit is contained in:
Liu Shilong 2024-01-25 19:00:04 +08:00 committed by GitHub
parent 001668e34a
commit fb2c3cdf14
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -43,6 +43,11 @@ variables:
value: rcache value: rcache
- name: ENABLE_FIPS - name: ENABLE_FIPS
value: n value: n
- name: BUILD_BRANCH
${{ if eq(variables['Build.Reason'], 'PullRequest') }}:
value: $(System.PullRequest.TargetBranch)
${{ else }}:
value: $(Build.SourceBranchName)
stages: stages:
- stage: BuildVS - stage: BuildVS
@ -166,7 +171,7 @@ stages:
TOPOLOGY: t0 TOPOLOGY: t0
MIN_WORKER: $(T0_INSTANCE_NUM) MIN_WORKER: $(T0_INSTANCE_NUM)
MAX_WORKER: $(T0_INSTANCE_NUM) MAX_WORKER: $(T0_INSTANCE_NUM)
MGMT_BRANCH: "master" MGMT_BRANCH: $(BUILD_BRANCH)
- job: t0_2vlans_elastictest - job: t0_2vlans_elastictest
pool: ubuntu-20.04 pool: ubuntu-20.04
@ -180,7 +185,7 @@ stages:
TEST_SET: t0-2vlans TEST_SET: t0-2vlans
MIN_WORKER: $(T0_2VLANS_INSTANCE_NUM) MIN_WORKER: $(T0_2VLANS_INSTANCE_NUM)
MAX_WORKER: $(T0_2VLANS_INSTANCE_NUM) MAX_WORKER: $(T0_2VLANS_INSTANCE_NUM)
MGMT_BRANCH: "master" MGMT_BRANCH: $(BUILD_BRANCH)
DEPLOY_MG_EXTRA_PARAMS: "-e vlan_config=two_vlan_a" DEPLOY_MG_EXTRA_PARAMS: "-e vlan_config=two_vlan_a"
- job: t1_lag_elastictest - job: t1_lag_elastictest
@ -194,7 +199,7 @@ stages:
TOPOLOGY: t1-lag TOPOLOGY: t1-lag
MIN_WORKER: $(T1_LAG_INSTANCE_NUM) MIN_WORKER: $(T1_LAG_INSTANCE_NUM)
MAX_WORKER: $(T1_LAG_INSTANCE_NUM) MAX_WORKER: $(T1_LAG_INSTANCE_NUM)
MGMT_BRANCH: "master" MGMT_BRANCH: $(BUILD_BRANCH)
- job: multi_asic_elastictest - job: multi_asic_elastictest
displayName: "kvmtest-multi-asic-t1-lag by Elastictest" displayName: "kvmtest-multi-asic-t1-lag by Elastictest"
@ -209,7 +214,7 @@ stages:
MIN_WORKER: $(MULTI_ASIC_INSTANCE_NUM) MIN_WORKER: $(MULTI_ASIC_INSTANCE_NUM)
MAX_WORKER: $(MULTI_ASIC_INSTANCE_NUM) MAX_WORKER: $(MULTI_ASIC_INSTANCE_NUM)
NUM_ASIC: 4 NUM_ASIC: 4
MGMT_BRANCH: "master" MGMT_BRANCH: $(BUILD_BRANCH)
- job: dualtor_elastictest - job: dualtor_elastictest
pool: ubuntu-20.04 pool: ubuntu-20.04
@ -222,7 +227,7 @@ stages:
TOPOLOGY: dualtor TOPOLOGY: dualtor
MIN_WORKER: $(T0_DUALTOR_INSTANCE_NUM) MIN_WORKER: $(T0_DUALTOR_INSTANCE_NUM)
MAX_WORKER: $(T0_DUALTOR_INSTANCE_NUM) MAX_WORKER: $(T0_DUALTOR_INSTANCE_NUM)
MGMT_BRANCH: "master" MGMT_BRANCH: $(BUILD_BRANCH)
COMMON_EXTRA_PARAMS: "--disable_loganalyzer " COMMON_EXTRA_PARAMS: "--disable_loganalyzer "
- job: sonic_t0_elastictest - job: sonic_t0_elastictest
@ -237,7 +242,7 @@ stages:
MIN_WORKER: $(T0_SONIC_INSTANCE_NUM) MIN_WORKER: $(T0_SONIC_INSTANCE_NUM)
MAX_WORKER: $(T0_SONIC_INSTANCE_NUM) MAX_WORKER: $(T0_SONIC_INSTANCE_NUM)
TEST_SET: t0-sonic TEST_SET: t0-sonic
MGMT_BRANCH: "master" MGMT_BRANCH: $(BUILD_BRANCH)
COMMON_EXTRA_PARAMS: "--neighbor_type=sonic " COMMON_EXTRA_PARAMS: "--neighbor_type=sonic "
VM_TYPE: vsonic VM_TYPE: vsonic
@ -252,8 +257,7 @@ stages:
TOPOLOGY: dpu TOPOLOGY: dpu
MIN_WORKER: $(T0_SONIC_INSTANCE_NUM) MIN_WORKER: $(T0_SONIC_INSTANCE_NUM)
MAX_WORKER: $(T0_SONIC_INSTANCE_NUM) MAX_WORKER: $(T0_SONIC_INSTANCE_NUM)
KVM_IMAGE_BRANCH: "master" MGMT_BRANCH: $(BUILD_BRANCH)
MGMT_BRANCH: "master"
# - job: wan_elastictest # - job: wan_elastictest