【发布时间】:2022-01-16 23:09:25
【问题描述】:
我需要在 jenkinsfile 的批处理脚本中使用 groovy 函数参数。 我尝试了几种可能性,包括此处列出的所有内容:https://gist.github.com/Faheetah/e11bd0315c34ed32e681616e41279ef4,但我无法找到在我的批处理脚本中访问变量“示例”内容的解决方案。
def function(example) {
...
bat label: '', script: '''@echo off
...
...
mkdir "some path\\"value of example"\\some additional path"
'''
...
}
有什么办法吗?
【问题讨论】:
-
是的,有办法。
""" ... ${example} ... """ -
如果你是这样想的:mkdir """some path\\${example}\\some path""" that didn't work
-
didnt work是什么意思?有什么错误吗? -
没有错误,创建的文件夹名为 ${example}
标签: batch-file jenkins groovy jenkins-pipeline jenkins-groovy