jenkins pipeline script params not recognized, bad substitution error

71 views
Skip to first unread message

Justin Khoo

unread,
Jul 10, 2017, 5:46:17 PM7/10/17
to Jenkins Users
how can I read in the params from jenkins script shell sh? 

pipeline {
  stages{
   stage('Deploy') {
            steps {
                sh 'python deploy.py ${params.version}'
            }
        }
  }
}

I have tried several ways, but still not able to read in params.

Kai

unread,
Jul 10, 2017, 5:54:41 PM7/10/17
to Jenkins Users
I have a similar issue, I have a build job that is parameterized and am Not able to successfully use that parameter to pass as an argument to my python script in my pipeline stage

Jakub Pawlinski

unread,
Jul 11, 2017, 5:26:40 AM7/11/17
to Jenkins Users
try using double quote:

sh "python deploy.py ${params.version}"

I think single quotes do not evaluate strings

Kai

unread,
Jul 14, 2017, 1:26:29 PM7/14/17
to Jenkins Users
thanks so much, that worked!
Reply all
Reply to author
Forward
0 new messages