I am trying to create an node in the Jenkins slave using bash script through automation inside the bash script i need to pass the some environment variables but throwing an error bad substitution and also tried to pass secrets for authentication but throwing error bas substitution
Bash script:
NODE_NAME=${env.NODE_NAME}
LABELS=${env.labelName}
cat <<-EOF | java -jar jenkins-cli.jar -s https://localhost:8080/jenkins.com -http -auth ${{ secrets.Username }}:${{ secrets.API_Token }} create-node $NODE_NAME
<slave>
<name>${NODE_NAME}</name>
<label>${LABELS}</label>
<nodeProperties/>
<userId>${USERID}</userId>
</slave>
EOF