从管道中的scm将'带有参数的构建'传递给Jenkinsfile [英] Passing 'build with parameters' to Jenkinsfile from scm in pipeline

查看:306
本文介绍了从管道中的scm将'带有参数的构建'传递给Jenkinsfile的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在jenkins 2.x上并使用管道.

I am on jenkins 2.x and using pipeline.

我已将作业配置为使用param构建,并具有字符串param:

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

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

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

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

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

stdout:stderr:致命:'$ {githubUrl}'似乎不是git 仓库

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

因此,如果直接编写管道脚本,则可以,但是从scm提取失败.有什么想法如何解决它吗?

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

推荐答案

使用url: githubUrl,不带美元符号和括号.这是Groovy脚本,而不是Shell脚本

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

这篇关于从管道中的scm将'带有参数的构建'传递给Jenkinsfile的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆