在詹金斯中建立远程多分支管道

时间:2018-12-11 13:24:44

标签: jenkins jenkins-plugins jenkins-pipeline

我想使用参数化的远程触发器插件来运行远程项目(所有分支),并仅监视分支之一的状态。

node(''){
 triggerRemoteJob abortTriggeredJob: true, auth: CredentialsAuth(credentials: 'E2E'), job: 'http://localhost:8080/job/test-projectF', maxConn: 5, useCrumbCache: true, useJobInfoCache: true
}

这是我触发远程项目的代码。但是我最终遇到了一个例外

[Pipeline] {
[Pipeline] triggerRemoteJob################################################################################################################
Parameterized Remote Trigger Configuration:
- job:                     http://localhost:8080/job/test-projectF 
- auth:                    'Credentials Authentication' as user 'admin' (Credentials ID 'E2E')
- parameters:              
- blockBuildUntilComplete: true
- connectionRetryLimit:    5

 [Pipeline] }
 [Pipeline] // node
 [Pipeline] End of Pipeline
hudson.remoting.ProxyException: net.sf.json.JSONException: JSONObject["property"] is not a JSONArray.
at net.sf.json.JSONObject.getJSONArray(JSONObject.java:1986)
at org.jenkinsci.plugins.ParameterizedRemoteTrigger.RemoteBuildConfiguration.isRemoteJobParameterized(RemoteBuildConfiguration.java:1086)
at org.jenkinsci.plugins.ParameterizedRemoteTrigger.RemoteBuildConfiguration.performTriggerAndGetQueueId(RemoteBuildConfiguration.java:637)
at org.jenkinsci.plugins.ParameterizedRemoteTrigger.pipeline.RemoteBuildPipelineStep$Execution.run(RemoteBuildPipelineStep.java:263)
at org.jenkinsci.plugins.ParameterizedRemoteTrigger.pipeline.RemoteBuildPipelineStep$Execution.run(RemoteBuildPipelineStep.java:239)
at org.jenkinsci.plugins.workflow.steps.SynchronousNonBlockingStepExecution$1$1.call(SynchronousNonBlockingStepExecution.java:51)
at hudson.security.ACL.impersonate(ACL.java:290)
at org.jenkinsci.plugins.workflow.steps.SynchronousNonBlockingStepExecution$1.run(SynchronousNonBlockingStepExecution.java:48)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Finished: FAILURE

但是,具有分支名称的相同命令以SUCCESS结尾。 http://localhost:8080/job/test-projectF/job/master

在远程Jenkins上动态创建分支并跟踪状态的更好方法是什么?

0 个答案:

没有答案