here I'm triggering my Jenkins job from URL with some parameters and trying to get that parameter values in my pipeline script
Here is the command with URL:
curl -k -v -u user:secrate http://IP:PORT/jenkins/job/GROUP-GROUP/view/Deploy-Jobs/job/Automate-deployment-JOB/buildWithParameters?token=MY-TOCKEN&MY-PARAMETOR=some_value
Pipeline script of jenkins JOB:
pipeline {
agent none
stages{
stage ('test') {
agent { label 'My-Slave' }
steps {
println "$MY-PARAMETOR"
}
}
}
}
Here I'm able to trigger my Jenkins build but not getting the value in pipeline script
Getting the following error:
groovy.lang.MissingPropertyException: No such property: MY-PARAMETOR for class: groovy.lang.Binding
Can any one please help me on this?
Thanks,
You need to make sure the parameter is defined in the pipeline first. See:
(Somewhat duplicate to How to trigger Jenkins builds remotely and to pass parameters )
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.