X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=XTesting%2Fkubespray%2Fscripts%2Fgen_tags.sh;fp=XTesting%2Fkubespray%2Fscripts%2Fgen_tags.sh;h=1bc94c80bba9c315ab81d89fc584038e60a9432a;hb=31af17bb5935b722dcf59d5800aaff9e789cfa93;hp=0000000000000000000000000000000000000000;hpb=c8bda4f07b7e87beb2aa3d8729f9b0b456d4da6f;p=it%2Ftest.git diff --git a/XTesting/kubespray/scripts/gen_tags.sh b/XTesting/kubespray/scripts/gen_tags.sh new file mode 100755 index 0000000..1bc94c8 --- /dev/null +++ b/XTesting/kubespray/scripts/gen_tags.sh @@ -0,0 +1,12 @@ +#!/bin/sh +set -eo pipefail + +#Generate MD formatted tags from roles and cluster yaml files +printf "|%25s |%9s\n" "Tag name" "Used for" +echo "|--------------------------|---------" +tags=$(grep -r tags: . | perl -ne '/tags:\s\[?(([\w\-_]+,?\s?)+)/ && printf "%s ", "$1"'|\ + perl -ne 'print join "\n", split /\s|,/' | sort -u) +for tag in $tags; do + match=$(cat docs/ansible.md | perl -ne "/^\|\s+${tag}\s\|\s+((\S+\s?)+)/ && printf \$1") + printf "|%25s |%s\n" "${tag}" " ${match}" +done