EnvInj-pluginを介して変数を挿入する関数を記述しました。スクリプト以下の私が使用:JenkinsパイプラインMissingMethodException:メソッドの署名がありません:
import hudson.model.*
import static hudson.model.Cause.RemoteCause
@com.cloudbees.groovy.cps.NonCPS
def call(currentBuild) {
def ipaddress=""
for (CauseAction action : currentBuild.getActions(CauseAction.class)) {
for (Cause cause : action.getCauses()) {
if(cause instanceof RemoteCause){
ipaddress=cause.addr
break;
}
}
}
return ["ip":ipaddress]
}
私はそれをグローバル関数としてフォルダ$ JENKINS_HOME /ワークフロー-libsに/ VARSを入れたとき、私は次のエラーを取得する:
hudson.remoting.ProxyException: groovy.lang.MissingMethodException: No signature of method: org.jenkinsci.plugins.workflow.support.steps.build.RunWrapper.getActions() is applicable for argument types: (java.lang.Class) values: [class hudson.model.CauseAction]
私はcompletly新しいです私はなぜそれが動作していないのかわかりません。 EnvInj-pluginではうまくいきました。誰でも助けてくれますか?
最初のものは私のために正常に動作作品を願って - あなたはあなたが
Manage Jenkins
を介してこれを承認することにより、この問題を解決することができますRejectedSandboxException
がわかります!ありがとうリック!!!!!最高の男:) – user3296316