从管道中的scm将'带有参数的构建'传递给Jenkinsfile

编程入门 行业动态 更新时间:2024-10-28 16:20:03
本文介绍了从管道中的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

本文发布于:2023-07-07 04:44:42,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1058929.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:道中   参数   scm   Jenkinsfile

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!