File tree Expand file tree Collapse file tree 4 files changed +36
-6
lines changed
Expand file tree Collapse file tree 4 files changed +36
-6
lines changed Original file line number Diff line number Diff line change 11.PHONY : generateMatrices
22generateMatrices :
3+ @echo " Installing Python dependencies..."
34 pip3 install -r requirements.txt
5+
6+ @echo "Generating strategy matrix..."
47 python3 strategyMatrix.py > strategyMatrix.json
5- # work only with missing packages either in prod or staging
8+
9+ @echo "Printing jq version..."
10+ jq --version
11+
12+ @echo "Validating strategyMatrix.json..."
13+ python3 -c "import json; json.load(open('strategyMatrix.json'))" || { echo 'Invalid JSON in strategyMatrix.json'; exit 1; }
14+
15+ @echo "Pretty Printing strategyMatrix.json..."
16+ jq '.' strategyMatrix.json
17+
18+ @echo "Work only with missing packages either in prod or staging..."
619 cat strategyMatrix.json | jq 'map(select(.isProduction == false or .isStaging == false))' -c > prodAndStagingMatrix.json
20+
21+ @echo "Generating SLES matrix..."
722 cat prodAndStagingMatrix.json | jq 'map(select(.osDistro == "sles"))' -c > slesMatrix.json
23+
24+ @echo "Generating Linux and Windows matrix..."
825 cat prodAndStagingMatrix.json | jq 'map(select(.osDistro != "sles"))' -c > linuxAndWindowsMatrix.json
26+
27+ @echo "Generating Windows matrix..."
928 cat prodAndStagingMatrix.json | jq 'map(select(.osDistro == "windows-server"))' -c > windowsMatrix.json
29+
30+
1031 # used to generate proper schemas in schema.linux.py
32+ @echo "Generating staging matrix..."
1133 cat strategyMatrix.json | jq 'map(select(.isStaging == false))' -c > stagingMatrix.json
34+
35+ @echo "Generating production matrix..."
1236 cat strategyMatrix.json | jq 'map(select(.isProduction == false))' -c > productionMatrix.json
Original file line number Diff line number Diff line change 1- fbVersion : 3.2.7
1+ fbVersion : 3.2.10
22
33# This file, together with each distro file are processed and merged incrementally to
44# build all the information required to download and test each package. Each package ends
Original file line number Diff line number Diff line change @@ -186,15 +186,16 @@ def list_distro_files():
186186 return [
187187 filename
188188 for filename in os .listdir ("." )
189- if (filename .endswith (".yml" ) or filename .endswith (".yaml" ))
189+ if (( filename .endswith (".yml" ) or filename .endswith (".yaml" )) and filename . startswith ( "windows- " ))
190190 and filename != "common.yml"
191191 ]
192192 except Exception as e :
193193 print (f"Error while reading distribution package files: { e } " )
194+ # should not this be exit as running the job with empty one has no outcome?
194195 return []
195196
196197
197- def generate_matrix ():
198+ def generate_matrix ():
198199 return [
199200 add_package_details (package_data )
200201 for distro_file in list_distro_files ()
@@ -214,7 +215,7 @@ def add_availability_flags(matrix):
214215 pkg ["isStaging" ] = True if response .status_code == 200 else False
215216
216217
217- if __name__ == "__main__" :
218+ if __name__ == "__main__" :
218219 matrix = generate_matrix ()
219220 add_availability_flags (matrix )
220- print (json .dumps (matrix ))
221+ print (json .dumps (matrix , indent = 2 ))
Original file line number Diff line number Diff line change 1+ osDistro : windows-server
2+ osVersion : 2025
3+ packages :
4+ - arch : win64
5+ ami : ami-03eac6ae588965b06
You can’t perform that action at this time.
0 commit comments