Jenkins 多配置项目处理并发设备使用

Jenkins multiconfiguration project handle concurrent device usage

案例

我有一个 Jenkins slave 运行 在移动设备上的 calabash 测试(android,ios)。为了区分哪个machines(mac代表iOS或Linux代表Android)测试是运行,我还使用节流并发构建插件。通过这种方式,我将设备所连接的 Android 或 Mac Jenkins 奴隶分开。

我使用一个映射 table 和一个自写的 bash 脚本来按名称调用设备并在这个特定的从属设备上执行测试。映射 table 将名称映射到设备 ID(或 iOS 的 IP)。

架构如下:

[Master]--(Slave-iOS)---------iPhone6
 |             |--------------iPhone5
 |            
 |--------(Slave-Android)-----HTCOne
               |--------------Nexus
               |--------------G4

为了将设备移交给 bash 脚本,我使用了 Jenkins Matrix 项目插件,它让我创建了一个设备列表和测试用例,例如:

          HTCOne Nexus G4
Run         x     x     x
Delete      x     x     x
CreateUser  x     x     x

遗憾的是这个列表只能按顺序执行。现在我也想在多个设备上并行构建测试,反之亦然。

问题

I search for a Jenkins plugin which handles devices allocation. If one trigger needs a specific device it should wait until this one is accessible and the test can be executed. The plugin should integrate with the shell execution in Jenkins.

如果能与 Matrix Project Plugin 结合使用就更好了!

到目前为止我调查的内容:

我发现的相关问题,对问题有帮助但没有解决问题:

如果 Throttle Concurrent Builds Plugin 在您的 多配置项目 中无法按要求工作,请尝试 Exclusion Plugin 使用动态资源名称,例如:SEMAPHORE_MATRIX_${NODE_NAME}

然后添加一个构建步骤 "Critical block start"(和一个可选的 "Critical block end" 步骤),它将保持此构建块执行直到 SEMAPHORE_MATRIX_${NODE_NAME} 不是正在用于任何其他作业,包括当前的 Matrix 子作业。

(...仅当 SEMAPHORE_MATRIX_${NODE_NAME} 可用时构建步骤为 运行...)