blob: df81c2e3288eac1d362a9a034520a722e4ca5147 [file] [log] [blame]
Brad Bishopbec4ebc2022-08-03 09:55:16 -04001#! /bin/bash
2
3# This script is expecting an input of machine name, optionally followed by a
4# colon and a list of one or more parameters separated by commas between
5# brackets. For example, the following are acceptable:
Patrick Williams73bd93f2024-02-20 08:07:48 -06006# corstone1000-mps3
7# fvp-base: [testimage]
8# qemuarm64-secureboot: [clang, glibc, testimage]
9# This argument should be quoted to avoid expansion and to be handled
10# as a single value.
11#
12# Any further arguments will be handled as further yml file basenames.
Brad Bishopbec4ebc2022-08-03 09:55:16 -040013#
14# Turn this list into a series of yml files separated by colons to pass to kas
15
16set -e -u
17
Patrick Williams73bd93f2024-02-20 08:07:48 -060018# First, parse the GitLab CI job name (CI_JOB_NAME via $1) and accumulate a list
19# of Kas files.
20JOBNAME="$1"
21shift
Brad Bishopbec4ebc2022-08-03 09:55:16 -040022
Patrick Williams73bd93f2024-02-20 08:07:48 -060023# The base name of the job
24FILES="ci/$(echo $JOBNAME | cut -d ':' -f 1).yml"
25
26# The list of matrix variations
27for i in $(echo $JOBNAME | cut -s -d ':' -f 2 | sed 's/[][,]//g'); do
Brad Bishopbec4ebc2022-08-03 09:55:16 -040028 # Given that there are no yml files for gcc or glibc, as those are the
29 # defaults, we can simply ignore those parameters. They are necessary
30 # to pass in so that matrix can correctly setup all of the permutations
31 # of each individual run.
Andrew Geissler2daf84b2023-03-31 09:57:23 -050032 if [[ $i == 'none' ]]; then
Brad Bishopbec4ebc2022-08-03 09:55:16 -040033 continue
34 fi
35 FILES+=":ci/$i.yml"
36done
37
Patrick Williams73bd93f2024-02-20 08:07:48 -060038# Now pick up any further names
39for i in $*; do
40 FILES+=":ci/$i.yml"
41done
42
Brad Bishopbec4ebc2022-08-03 09:55:16 -040043echo $FILES