将 'build with parameters' 从管道中的 scm 传递到 Jenkinsfile

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

我正在使用 jenkins 2.x 并使用管道。

我已经配置了要使用参数构建的作业,并且有一个字符串参数:

我还从 github 获取 Jenkinsfile(来自脚本的管道):

现在在我的 Jenkinsfile 中,我正在使用参数:${githubUrl} 并抛出错误:

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

因此,如果直接编写管道脚本,这可行,但从 scm 获取失败。任何想法如何解决它?

使用不带美元符号和曲线括号的 url: githubUrl。这是 Groovy 脚本,而不是 shell 脚本