Yes with a little work. If JobParent calls jobChild and you want to have variableChild1 (that you may have created in jobChild job) to be visible in jobParent job then do the following simple steps.
In the child job, create a file (variable=value) pair with all the variables in it. Lets call it child or downstream_job or jobChild_envs.txt
Now, once jobParent is done calling jobChild (I guess you are calling Trigger another project or Build other project steps etc), next action just would be to use "Copy Artifact from another project/job" (Copy Artifact plugin in Jenkins). PS: You would need to click on the check box to FLATTEN the file (see jobParent image below). https://wiki.jenkins-ci.org/display/JENKINS/Copy+Artifact+Plugin
Using this plugin, you'll be able to get a file/folder from jobChild's workspace into jobParent's workspace in a defined/base workspace location.
在 jobParent 中,您将注入环境变量(在 BUILD 步骤中)。 https://wiki.jenkins-ci.org/display/JENKINS/EnvInject+Plugin
这时候,如果jobChild作业创建了一个.txt文件,里面有一个变量为ex:
variableChild1=valueChild1
Run Code Online (Sandbox Code Playgroud)
在其中,然后它对父/上游作业 jobParent 可用/可见。
有关更多详细信息,请参阅图像并在最后运行作业以查看输出。
和
| 归档时间: |
|
| 查看次数: |
6339 次 |
| 最近记录: |