move more standard questions.yaml portions to includes

This commit is contained in:
kjeld Schouten-Lebbing
2021-09-13 11:12:18 +02:00
parent 65ac1c2d0a
commit 90ee94cf11
10 changed files with 651 additions and 616 deletions

View File

@@ -125,10 +125,41 @@ include_questions(){
local chartversion="$4"
local target="catalog/${train}/${chartname}/${chartversion}"
echo "Including standardised questions.yaml includes for: ${chartname}"
# Replace # Include{VPN} with the standard VPN codesnippet
# Replace # Include{groups} with the standard groups codesnippet
awk 'NR==FNR { a[n++]=$0; next }
/# Include{VPN}/ { for (i=0;i<n;++i) print a[i]; next }
1' templates/questions/vpn.yaml ${target}/questions.yaml > tmp && mv tmp ${target}/questions.yaml
/# Include{groups}/ { for (i=0;i<n;++i) print a[i]; next }
1' templates/questions/groups.yaml ${target}/questions.yaml > tmp && mv tmp ${target}/questions.yaml
# Replace # Include{controllerExpert} with the standard VPN codesnippet
awk 'NR==FNR { a[n++]=$0; next }
/# Include{controllerExpert}/ { for (i=0;i<n;++i) print a[i]; next }
1' templates/questions/controllerExpert.yaml ${target}/questions.yaml > tmp && mv tmp ${target}/questions.yaml
# Replace # Include{containerConfig} with the standard VPN codesnippet
awk 'NR==FNR { a[n++]=$0; next }
/# Include{containerConfig}/ { for (i=0;i<n;++i) print a[i]; next }
1' templates/questions/containerConfig.yaml ${target}/questions.yaml > tmp && mv tmp ${target}/questions.yaml
# Replace # Include{serviceList} with the standard VPN codesnippet
awk 'NR==FNR { a[n++]=$0; next }
/# Include{serviceList}/ { for (i=0;i<n;++i) print a[i]; next }
1' templates/questions/serviceList.yaml ${target}/questions.yaml > tmp && mv tmp ${target}/questions.yaml
# Replace # Include{persistenceList} with the standard VPN codesnippet
awk 'NR==FNR { a[n++]=$0; next }
/# Include{persistenceList}/ { for (i=0;i<n;++i) print a[i]; next }
1' templates/questions/persistenceList.yaml ${target}/questions.yaml > tmp && mv tmp ${target}/questions.yaml
# Replace # Include{ingressList} with the standard VPN codesnippet
awk 'NR==FNR { a[n++]=$0; next }
/# Include{ingressList}/ { for (i=0;i<n;++i) print a[i]; next }
1' templates/questions/ingressList.yaml ${target}/questions.yaml > tmp && mv tmp ${target}/questions.yaml
# Replace # Include{addons} with the standard VPN codesnippet
awk 'NR==FNR { a[n++]=$0; next }
/# Include{addons}/ { for (i=0;i<n;++i) print a[i]; next }
1' templates/questions/addons.yaml ${target}/questions.yaml > tmp && mv tmp ${target}/questions.yaml
}
clean_catalog() {