照着jenkins-gitlab-merge-request-builder-plugin/一步步配置,构建触发后开始拉代码,然后就error了
> git -c core.askpass=true fetch --tags --progress ssh://git@*** HIDDEN **.git +refs/heads/:refs/remotes/origin/*
> git rev-parse refs/remotes/origin/${gitlabSourceBranch}^{commit} # timeout=10
> git rev-parse refs/remotes/origin/refs/remotes/origin/${gitlabSourceBranch}^{commit} # timeout=10
> git rev-parse refs/remotes/origin/${gitlabSourceBranch}^{commit}
# timeout=10
ERROR: Couldn't find any revision to build. Verify the repository and branch configuration for this job.
Finished: FAILURE
从log来看是插件的参数${gitlabSourceBranch}没有生效,一直怀疑是不是哪一步弄错了,一时没解决就放着,今天去看了看另一个插件Gitlab Plugin,Readme
里面提到一个Jenkins的Security updates,Jenkins修改了参数的传递方式,部分插件开发者可能没来得及更新,文末放出了work around
。
Set
hudson.model.ParametersAction.keepUndefinedParameters
totrue
, e.g.java -Dhudson.model.ParametersAction.keepUndefinedParameters=true -jar jenkins.war
to revert to the old behavior of allowing any build parameters. Depending on your environment, this may be unsafe, as it opens you up to attacks as described above.
Sethudson.model.ParametersAction.safeParameters
to a comma-separated list of safe parameter names, e.g.java -Dhudson.model.ParametersAction.safeParameters=FOO,BAR_baz,quX -jar jenkins.war
.
搞定后顺便给插件提了Issue