[英][Generic Webhook Trigger Plugin]Multiple Resolved Variables in Github Push Payload for single Generic Variable
I have the generic Variables like one below in my jenkins pipeline我的 jenkins 管道中有如下通用变量
parameters {
stringParam('DOCKER_FILE', "", "Select the Dockerfile Directory [dirname] to be built")
}
genericVariable {
key("DOCKER_FILE") //maven-mongodb
value("\$.head_commit.['modified','added'][*]") //all directory names
regexpFilter("/Dockerfile")
expressionType("JSONPath")
}
But when I see Github push payload body I can see resolved variables as "DOCKER_FILE":"[]" and "DOCKER_FILE_0":"[]"...This is because I have added 2 (modified,added) in which "DOCKER_FILE" will have all values while _0 and _1 will have their own like但是当我看到 Github 推送有效负载主体时,我可以看到已解析的变量为“DOCKER_FILE”:“[]”和“DOCKER_FILE_0”:“[]”......这是因为我添加了 2(修改后,添加)其中“DOCKER_FILE " 将具有所有值,而 _0 和 _1 将具有自己的like
https://github.com/jenkinsci/generic-webhook-trigger-plugin/blob/master/src/test/resources/org/jenkinsci/plugins/gwt/bdd/github/github-push-get-changed-files.feature https://github.com/jenkinsci/generic-webhook-trigger-plugin/blob/master/src/test/resources/org/jenkinsci/plugins/gwt/bdd/github/github-push-get-changed-files。特征
Scenario:设想:
In my Jenkins Pipeline在我的 Jenkins 管道中
For Manual Trigger -> Parameter I have is only DOCKER_FILE and "DOCKER_FILE_0" is undefined对于手动触发-> 我只有DOCKER_FILE的参数并且“DOCKER_FILE_0”未定义
For webhook trigger -> Through Generic Variables I will have both DOCKER_FILE and DOCKER_FILE_0对于 webhook 触发器 -> 通过通用变量,我将同时拥有 DOCKER_FILE 和 DOCKER_FILE_0
Query:询问:
**How can I use the value of "DOCKER_FILE_0" in my pipeline for manual trigger? **如何在管道中使用“DOCKER_FILE_0”的值进行手动触发?
Or else How can I get "maven-mongodb/file1.txt" from DOCKER_FILE without [] Below are my contributing variables **否则如何在没有 [] 的情况下从 DOCKER_FILE 获取“maven-mongodb/file1.txt”以下是我的贡献变量**
During Webhook trigger my Contributing variables:在 Webhook 期间触发我的贡献变量:
DOCKER_FILE = ["maven-mongodb/file1.txt","maven-mongodb/file2.txt"]
DOCKER_FILE_0 = maven-mongodb/file1.txt
DOCKER_FILE_1 = maven-mongodb/file2.txt
ie.DOCKER_FILE_0 will be automatically created during push event with generic webhook trigger ie.DOCKER_FILE_0 将在推送事件期间使用通用 webhook 触发器自动创建
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.