I have created a parameterized pipeline project in jenkins but i am not able to access those parameters in shell script
Below is the script i am using in pipeline
node {
echo "Download files from FTP"
sh '''
# read servers details for the instance selected
keyName=`$(cat ServerDetails.json | jq .rdpEnv.${params.Instance}.keyName)`
}
It is failing with below error
cat ServerDetails.json
/var/lib/jenkins/workspace/CPS Instance Update - AWS@tmp/durable-
bd57b5d5/script.sh: line 4: .rdpEnv.${params.Instance}.keyName: bad
substitution
cat: write error: Broken pipe
keyName=
[Pipeline] }
[Pipeline] // node
[Pipeline] End of Pipeline
ERROR: script returned exit code 1