Scooby
Scooby

Reputation: 3581

Passing 'build with parameters' to Jenkinsfile from scm in pipeline

I am on jenkins 2.x and using pipeline.

I have configured the job to be built with param and have a string param :

parameter

I also get the Jenkinsfile from github ( pipeline from script) :

Now in my Jenkinsfile, I am using the param : ${githubUrl} and it throws error :

stdout: stderr: fatal: '${githubUrl}' does not appear to be a git repository

So if directly write the pipeline script , this works but fetching from scm fails. Any ideas how to get around it ?

Upvotes: 3

Views: 8239

Answers (1)

Aleksandr
Aleksandr

Reputation: 181

Use url: githubUrl without dollar sign and curve brackets. It's Groovy script, not shell script

Upvotes: 11

Related Questions