【发布时间】:2019-08-23 10:33:35
【问题描述】:
我有两个管道,当我调用另一个共享库时出现以下错误-
hudson.remoting.ProxyException:groovy.lang.MissingMethodException:没有方法签名:genric.call() 适用于参数类型:() 值:[] 可能的解决方案:wait()、any()、wait(long)、main([Ljava.lang.String;)、any(groovy.lang.Closure)、each(groovy.lang.Closure)
以下是我的两个文件。
genric.groovy file
#!/usr/bin/env groovy
//import hudson.model.*
pipeline{
agent any
stages{
stage('build-deploy'){
steps{
sh'''
cd /home/manish/Desktop/test/
mkdir testing
'''
}
}
}
}
Jenkinsfile
library identifier: 'genric.groovy@master', retriever: modernSCM([$class: 'GitSCMSource', credentialsId: '', remote: 'https://github.com/mani1soni/jenkins-practice.git', traits: [[$class: 'jenkins.plugins.git.traits.BranchDiscoveryTrait']]])
pipeline{
agent any
environment{
REPO_PATH='/home/manish/Desktop'
APP_NAME='test'
}
stages{
stage('calling function'){
steps{
genric()
}
}
}
}
如何解决?
忽略环境字段
【问题讨论】:
-
在 Dilip 共享的链接中,它解释说您可以使用带有单个文件的 vars 文件夹来定义步骤或定义整个管道定义(“定义声明性管道”部分。您不能将这两者混合使用。
标签: groovy jenkins-pipeline shared-libraries