Jenkins Workflow: How to get or set step id

末鹿安然 提交于 2019-12-02 06:40:41

问题


We would like to reference a step inside a parallel task of a Jenkins workflow. But it seems that step IDs are created non deterministic for steps in multiple parallel tasks. For a input step it is possible to manually specify the step id. Is it either possible to specify a step id for a shell step or query the step id?

The purpose is that we would like to create a link to a shell script inside a parallel task.


回答1:


Indeed step IDs are not in general predictable in advance. Do you want to link to its log, like this? I am not entirely clear about the use case.

The closest existing RFE would be JENKINS-28119.




回答2:


Perhaps you want to use the input ID instead of step ID:

node {
  input id: 'input1', message: 'Continue?'
}

Then the input URL would exposed as:

http://[jenkins_base_URL]/job/[job_name]/[build_id]/input/Input1/proceedEmpty

(Note the capitalization on the input ID).



来源:https://stackoverflow.com/questions/32669800/jenkins-workflow-how-to-get-or-set-step-id

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!