开发者

How to share the BUILD_NUMBER between jobs with Hudson

开发者 https://www.devze.com 2023-01-06 21:23 出处:网络
I have separated a big Hudson job into smaller jobs. Job A does the main build and Job B does another build with a different configuration. I have configured Hudson, so that the A triggers B and that

I have separated a big Hudson job into smaller jobs. Job A does the main build and Job B does another build with a different configuration. I have configured Hudson, so that the A triggers B and that works fine, the problem is that Job A has the original build number and B has started from 1.

My question is: Is it possible to pass the BUILD_NUMBER environment variable somehow from Job A to Job B? The bui开发者_JAVA技巧ld number is used in the build artifact names, hence it would be nice to have the numbers match between artifacts.

Thanks.


Use the parametrized Parameterized Trigger Plugin, which will allow you to pass the build number from A to B. You will not be able to actually set the build number in job B, but you will have the build number from A to generate your version number.

If you want to synchronize the build number, you can edit the file nextBuildNumber in the job directory to match the number from job A. Be aware that these numbers will drift apart over the time since when A fails B will not be started.

EDIT I just stumbled across the Next Build Number Plugin. Have a look, If this one helps you.

0

精彩评论

暂无评论...
验证码 换一张
取 消