我得到了这个 vars/libOne
将composeFileNames
参数作为字符串列表的共享库。
#!/usr/bin/env groov
def call(String param1, String param2, String parm3, String[] composeFileNames ) {
String s =''
for (int i = 0; i < composeFileNames.size(); i++) { s +=' -f ./'+ composeFileNames[i] }
}
....
如果我在 Jenkins 中定义了管道步骤和映射变量,libOne
则会在另一个共享库中调用它:/vars/libTwo
#!/usr/bin/env groovy
def call(Map pipelineParams) {
node (...) {
stage("call libOne"){
libOne (pipelineParams.param1, pipelineParams.param2, pipelineParams.param3, pipelineParams.composeFileNames )
}
我想在 jenkins 中调用我的 libTwo 并将两个字符串参数传递为composeFileNames
:
@Library('myLib ') _
libTwo(param1: 'string ',
param2: 'string',
param3: 'string',
composeFileNames: ['string1','string2']
)
问题是我该如何正确地做到这一点,因为上面的代码给了我错误:
hudson.remoting.ProxyException: groovy.lang.MissingMethodException: No signature of method: dockerComposeVicDeploy.call() is applicable for argument types: (java.lang.String, java.lang.String, java.lang.String, java.util.ArrayList) values: [param1, pamam2, param3, ...]