我在jenkins中创建了一个参数化管道项目,但我无法在shell脚本中访问这些参数
以下是我在管道中使用的脚本
node {
echo "Download files from FTP"
sh '''
# read servers details for the instance selected
keyName=`$(cat ServerDetails.json | jq .rdpEnv.${params.Instance}.keyName)`
}
失败并出现以下错误
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