Jenkins job type: Multi-configuration project
很多时候我们要copy n个Jenkins job去run automation project, 只因为想同时跑几种不同的parameter choice. 创建一个Multi-configuration project的Jenkins job就可以解决这个问题。
具体操作如下:
- new item -> select "Multi-configuration project".
- configurate the parent job salve server label in Adanced Project Options.
- add "User-defined Axis" to Configuration Matrix, 把需要并发跑的parameter choice配在这里.
- add "Slaves" to Configuration Matrix, 点开“Labels”选项,选择salve server label.
- set Trigger for matrix projects to "Trigger for each configuration", default value is "Trigger only the parent job".
- 其他配置跟之前project一样配就可以了.
- 最后run job后,会看到你设置的parameter choice对应的sub jobs都在并发run,跑完后,会收到每个sub job自己的那份automation report email.
补充:
默认parameter choice是并发模式跑的,但如果想一个跑完接着一个跑,就勾选“Run each configuration sequentially” under Excecution Strategy。