Skip to content

Commit 1e006af

Browse files
committed
test: view variable group
1 parent b0f9c8c commit 1e006af

File tree

3 files changed

+176
-0
lines changed

3 files changed

+176
-0
lines changed
Lines changed: 118 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,118 @@
1+
pr: none
2+
trigger: none
3+
4+
variables:
5+
- group: ACN-CNI-Pipeline
6+
7+
stages:
8+
- stage: setup
9+
displayName: Variable Group Init
10+
jobs:
11+
- job: env
12+
displayName: Setup
13+
pool:
14+
name: "$(BUILD_POOL_NAME_DEFAULT)"
15+
steps:
16+
- script: |
17+
# To use the variables below, you must make the respective stage's dependsOn have - setup or it will not retain context of this stage
18+
19+
echo "##vso[task.setvariable variable=commitID;isOutput=true]$(echo $(make revision)-$(date "+%d%H%M"))"
20+
name: "EnvironmentalVariables"
21+
displayName: "Set environmental variables"
22+
condition: always()
23+
- job: vgroup
24+
displayName: View Variable Group
25+
pool:
26+
name: "$(BUILD_POOL_NAME_DEFAULT)"
27+
steps:
28+
- task: AzureCLI@2
29+
inputs:
30+
azureSubscription: $(BUILD_VALIDATIONS_SERVICE_CONNECTION)
31+
scriptLocation: "inlineScript"
32+
scriptType: "bash"
33+
addSpnToEnvironment: true
34+
inlineScript: |
35+
az pipelines variable-group show --id $(CNI_VAR_GROUP) --org $(System.TeamFoundationCollectionUri) --project $(System.TeamProject) --debug
36+
37+
displayName: "Configure Defaults and List"
38+
condition: always()
39+
env:
40+
AZURE_DEVOPS_EXT_PAT: $(System.AccessToken)
41+
42+
- bash: |
43+
az pipelines variable-group variable update --id $(CNI_VAR_GROUP) --org $(System.TeamFoundationCollectionUri) --project $(System.TeamProject) --name CILIUM_IMAGE_REGISTRY --value "Changed it was"
44+
displayName: "Change Variable"
45+
env:
46+
AZURE_DEVOPS_EXT_PAT: $(System.AccessToken)
47+
48+
- bash: |
49+
az pipelines variable-group show --id $(CNI_VAR_GROUP) --org $(System.TeamFoundationCollectionUri) --project $(System.TeamProject) --debug
50+
displayName: "List Variable Group"
51+
env:
52+
AZURE_DEVOPS_EXT_PAT: $(System.AccessToken)
53+
54+
55+
- stage: cluster
56+
displayName: "Cluster Create"
57+
dependsOn:
58+
- setup
59+
variables:
60+
commitID: $[ stagedependencies.setup.env.outputs['EnvironmentalVariables.commitID'] ]
61+
jobs:
62+
- job: cluster29
63+
displayName: 1.29 Cluster Creation
64+
pool:
65+
name: "$(BUILD_POOL_NAME_DEFAULT)"
66+
strategy:
67+
matrix:
68+
cniv1:
69+
clusterType: cniv1-up
70+
clusterName: cniv1
71+
cilium:
72+
clusterType: overlay-cilium-up
73+
clusterName: cilium
74+
overlay:
75+
clusterType: overlay-up
76+
clusterName: overlay
77+
steps:
78+
- template: ../../templates/create-cluster-steps.yaml
79+
parameters:
80+
clusterType: $(clusterType)
81+
clusterName: $(clusterName)-29-$(commitID)
82+
k8sVersion: 1.29
83+
vmSize: Standard_B2ms
84+
vmSizeWin: Standard_B2ms
85+
os: windows
86+
region: $(REGION_AKS_CLUSTER_TEST)
87+
LTS: true
88+
89+
- stage: clusterDelete
90+
displayName: "Cluster Delete"
91+
condition: always()
92+
dependsOn:
93+
- setup
94+
- cluster
95+
variables:
96+
commitID: $[ stagedependencies.setup.env.outputs['EnvironmentalVariables.commitID'] ]
97+
jobs:
98+
- job: cluster29
99+
displayName: 1.29 Cluster Delete
100+
pool:
101+
name: "$(BUILD_POOL_NAME_DEFAULT)"
102+
strategy:
103+
matrix:
104+
cniv1:
105+
clusterName: cniv1
106+
cilium:
107+
clusterName: cilium
108+
overlay:
109+
clusterName: overlay
110+
steps:
111+
- template: ../../templates/delete-cluster.yaml
112+
parameters:
113+
name: $(clusterName)-29-$(commitID)
114+
clusterName: $(clusterName)-29-$(commitID)
115+
region: $(REGION_AKS_CLUSTER_TEST)
116+
sub: $(SUB_AZURE_NETWORK_AGENT_BUILD_VALIDATIONS)
117+
svcConn: $(BUILD_VALIDATIONS_SERVICE_CONNECTION)
118+
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
parameters:
2+
name: ""
3+
displayName: ""
4+
clusterType: ""
5+
clusterName: "" # Recommended to pass in unique identifier
6+
vmSize: ""
7+
vmSizeWin: ""
8+
k8sVersion: ""
9+
osSkuWin: "Windows2022" # Currently we only support Windows2022
10+
dependsOn: ""
11+
region: ""
12+
os: linux
13+
14+
15+
steps:
16+
- task: AzureCLI@2
17+
inputs:
18+
azureSubscription: $(BUILD_VALIDATIONS_SERVICE_CONNECTION)
19+
scriptLocation: "inlineScript"
20+
scriptType: "bash"
21+
addSpnToEnvironment: true
22+
inlineScript: |
23+
set -e
24+
echo "Check az version"
25+
az version
26+
if ${{ lower(contains(parameters.clusterType, 'dualstack')) }}
27+
then
28+
echo "Install az cli extension preview"
29+
az extension add --name aks-preview
30+
az extension update --name aks-preview
31+
fi
32+
33+
if ! [ -z ${{ parameters.k8sVersion }} ]; then
34+
echo "Set K8S_VER with ${{ parameters.k8sVersion }}"
35+
export K8S_VER=${{ parameters.k8sVersion }}
36+
fi
37+
38+
if ! [ -z ${K8S_VERSION} ]; then
39+
echo "Default k8s version, $(make -C ./hack/aks vars | grep K8S | cut -d'=' -f 2), is manually set to ${K8S_VERSION}"
40+
export K8S_VER=${K8S_VERSION}
41+
fi
42+
43+
mkdir -p ~/.kube/
44+
make -C ./hack/aks azcfg AZCLI=az REGION=${{ parameters.region }}
45+
46+
make -C ./hack/aks ${{ parameters.clusterType }} \
47+
AZCLI=az REGION=${{ parameters.region }} SUB=$(SUB_AZURE_NETWORK_AGENT_BUILD_VALIDATIONS) \
48+
CLUSTER=${{ parameters.clusterName }} \
49+
VM_SIZE=${{ parameters.vmSize }} VM_SIZE_WIN=${{ parameters.vmSizeWin }} \
50+
OS_SKU_WIN=${{ parameters.osSkuWin }} OS=${{ parameters.os }} \
51+
LTS=${{ parameters.os }}
52+
53+
echo "Cluster successfully created"
54+
displayName: Cluster - ${{ parameters.clusterType }}
55+
continueOnError: ${{ contains(parameters.clusterType, 'dualstack') }}

hack/aks/Makefile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,9 @@ overlay-up: rg-up ipv4 overlay-net-up ## Brings up an Overlay AzCNI cluster
219219
$(LTS_ARGS) \
220220
--yes
221221
@$(MAKE) set-kubeconf
222+
ifeq ($(OS),windows)
223+
$(MAKE) windows-nodepool-up
224+
endif
222225

223226
swift-byocni-up: rg-up ipv4 swift-net-up ## Bring up a SWIFT BYO CNI cluster
224227
$(AZCLI) aks create -n $(CLUSTER) -g $(GROUP) -l $(REGION) \

0 commit comments

Comments
 (0)