我希望通过$options
,这是我的Jenkinsfile中的字符串参数。下面是我的詹金斯档案。当我运行管道时,我得到这个错误:java.lang.NullPointerException: Cannot get property '$options' on null object
。我错过了什么?
pipeline {
agent {
docker {
image 'babylon_ansible:latest'
args '-u root'
}
}
stages {
stage('ansible playbook') {
steps {
script {
withCredentials([string(credentialsId: 'babylondumpspwd', variable: 'db_pass')]) {
sh 'pwd'
sh 'babylondumps' '$options`
}
}
}
}
}
}
可以用params.options
访问该参数,用sh "babylondumps ${params.options}"
调用sh