How to reference the variable inside the map . When I do this I only get literal string dcihub_sonar_binaries, while I expect the else rule to result to value of dcihub_sonar_binaries.
dcihub_sonar_binaries = '$WORKSPACE/tenants/dcihub/ui.apps/target/,$WORKSPACE/tenants/dcihub/ui.config/target/,$WORKSPACE/tenants/dcihub/ui.content/target/'
def CODEBASE = "dcihub"
def SonarValues = [:]
if (CODEBASE == "platform") {
SonarValues = ["platform": [platform_sonar_exclusion, platform_sonar_binaries]]
} else {
SonarValues.put(CODEBASE, "${CODEBASE}_sonar_binaries")
}
return SonarValues
}
When I print it. That is the ouput.
dcihub_sonar_binaries
Expected output :
'$WORKSPACE/tenants/dcihub/ui.apps/target/,$WORKSPACE/tenants/dcihub/ui.config/target/,$WORKSPACE/tenants/dcihub/ui.content/target/
'