问题
I am on jenkins 2.x and using pipeline.
I have configured the job to be built with param and have a string param :
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 ?
回答1:
Use url: githubUrl
without dollar sign and curve brackets. It's Groovy script, not shell script
来源:https://stackoverflow.com/questions/39254262/passing-build-with-parameters-to-jenkinsfile-from-scm-in-pipeline