I'm working in a GitLab runner environment and CICD Variables with two familiar strings in my bash script and I would change one of these strings in the middle to build a final string. For example:
$CICD_MY_INTERNAL_STRING
$CICD_MY_EXTERNAL_STRING
So now these strings are in my function "workerapp()" and I would make this string dynamic.
function workerapp() {
echo -e $CICD_MY_$1_STRING
}
Now I would call the function like this
workerapp INTERNAL
workerapp EXTERNAL
to get these results
"$CICD_MY_INTERNAL_STRING" and "$CICD_MY_EXTERNAL_STRING" to work with it in another functions / calls.
Currently I got only these results "$CICD_MY_EXTERNAL" ... without the rest of my strings.