正文

Jenkins transfer variable to other job

(2019-04-30 10:49:42) 下一个


Goto JOB_1 and add a Post-Build action (Trigger parameterized build on other projects)
Type the project to build JOB_2
Add Parameters (Predefined Parameters)
Type the following in the Parameters box: test1=${test1}
Apply and Save
MOST IMPORTANT: YOU MUST ADD THIS PARAMETER (test1) to JOB_2
Goto and check "This build is parameterized" and add a "String Parameter"
Type "test1" (Must be same name) and put in a default value 


It's now an environment variable, to access it, all you need is $test1
In your build step,

ie echo $test1  and it will display

[ 打印 ]
阅读 ()评论 (0)
评论
目前还没有任何评论
登录后才可评论.