简体   繁体   中英

Not getting parameter value while using Jenkins job trigger using URL

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,

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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM