Skip to content

Commit

Permalink
Merge pull request TencentBlueKing#7966 from yongyiduan/issue_7931
Browse files Browse the repository at this point in the history
【导出】流水线导出为Stream YAML 时,git 相关的拉代码插件,统一映射到 checkout 关键字 TencentBlueKing#7931
  • Loading branch information
bkci-bot authored Nov 22, 2022
2 parents 64e047d + 8b38760 commit 0f603eb
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,18 @@ class PipelineContextService @Autowired constructor(
val failTaskNameList = mutableListOf<String>()
try {
modelDetail.model.stages.forEach { stage ->
if (stage.checkIn?.status == BuildStatus.REVIEW_ABORT.name) {
previousStageStatus = BuildStatus.FAILED
}
if (stage.finally && stage.id?.let { it == stageId } == true) {
contextMap["ci.build_status"] = previousStageStatus.name
contextMap["ci.build_fail_tasknames"] = failTaskNameList.joinToString(",")
} else if (checkBuildStatus(stage.status)) {
previousStageStatus = BuildStatus.parse(stage.status)
}
if (stage.checkOut?.status == BuildStatus.QUALITY_CHECK_FAIL.name) {
previousStageStatus = BuildStatus.FAILED
}
stage.containers.forEach nextContainer@{ container ->
// 如果有分裂Job则只处理分裂Job的上下文
container.fetchGroupContainers()?.let { self ->
Expand Down Expand Up @@ -135,9 +141,15 @@ class PipelineContextService @Autowired constructor(
if (stage.finally) {
return@forEach
}
if (stage.checkIn?.status == BuildStatus.REVIEW_ABORT.name) {
previousStageStatus = BuildStatus.FAILED
}
if (checkBuildStatus(stage.status)) {
previousStageStatus = BuildStatus.parse(stage.status)
}
if (stage.checkOut?.status == BuildStatus.QUALITY_CHECK_FAIL.name) {
previousStageStatus = BuildStatus.FAILED
}
stage.containers.forEach nextContainer@{ container ->
// 如果有分裂Job则只处理分裂Job的上下文
container.fetchGroupContainers()?.let { self ->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ import io.swagger.annotations.ApiModelProperty
*/
@JsonFilter(YAME_META_DATA_JSON_FILTER)
data class PreStep(
val checkout: String?,
val name: String?,
val id: String?,
@ApiModelProperty(name = "if")
Expand All @@ -61,6 +62,5 @@ data class PreStep(
val env: Map<String, Any?>? = emptyMap(),
val run: String?,
val shell: String?,
val checkout: String?,
override val yamlMetaData: MetaData? = null
) : YamlMetaData

0 comments on commit 0f603eb

Please sign in to comment.