Trigger from GIT to Jenkins buildWithParameters ignores parameter value in pipeline

11 views
Skip to first unread message

Jaroslav Koblizek

unread,
Mar 20, 2019, 9:00:32 AM3/20/19
to Jenkins Users

I have a post-receive hook in GIT (works ok) which calls


http://ip:port/job/project_name/buildWithParameters?token=abc&ABC=qwe
 

ABC is my parameter which is defined in Jenkins' project as String parameter with default value xyz. URL has value qwe.


enter image description here


My Jenkins pipeline script is


pipeline {
    agent any
    stages {
        stage('Checkout') {
            steps {
                print env.ABC
            }
        }
    }
}


When the build is triggered from GIT, env.ABC prints xyz and not qwe.


enter image description here


How to get the value qwe from the URL ? My goal is to pass versioned tag name from GIT to pipeline.


Thanks

Aaron Digulla

unread,
Mar 20, 2019, 9:23:21 AM3/20/19
to Jenkins Users
 Use

    params.ABC

"params" contains build parameters, "env" the environment.

--
Aaron Digulla

Jaroslav Koblizek

unread,
Mar 20, 2019, 12:37:14 PM3/20/19
to Jenkins Users
Reply all
Reply to author
Forward
0 new messages