https://www.jetbrains.com/help/teamcity/kotlin-dsl.html#Build+Chain+DSL+Extension 这里有一个示例,说明如何声明构建类型并将 onDependencyFailure 添加到并行运行中。
project {
buildType(Compile)
buildType(Test1)
buildType(Test2)
buildType(Package)
buildType(Deploy)
buildType(Extra)
...
sequential {
buildType(Compile)
parallel (options = { onDependencyFailure = FailureAction.CANCEL }) { // non-default snapshot dependency options
dependsOn(Extra) // extra dependency to be defined in all builds in the parallel block
buildType(Test1)
buildType(Test2)
}
buildType(Package)
buildType(Deploy)
}
}
在下一个片段中,他们的代码就像我一样
project {
// build chain definition:
val buildChain = sequential {
...
}
// register all build configurations, referenced in the chain, in the current project:
buildChain.buildTypes().forEach { buildType(it) }
}
如何将 onDependencyFailure 添加到迭代对象 buildChain 中的所有依赖项。奇怪的是,当 prev buildtypes 失败时,依赖项仍然尝试运行。(TeamCity Enterprise 2021.1.1(内部版本 92714))