Skip to content

Commit

Permalink
feat:Git分支/Tag和Svn分支/Tag类型的变量优化 #10774
Browse files Browse the repository at this point in the history
  • Loading branch information
hejieehe committed Oct 31, 2024
1 parent 46b3d04 commit f30add6
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -484,7 +484,7 @@ data class StartBuildContext(
private fun fillCascadeParam(
param: BuildParameters,
originStartContexts: HashMap<String, BuildParameters>,
):List<BuildParameters> {
): List<BuildParameters> {
val originStartParams = mutableListOf<BuildParameters>()
val key = param.key
val paramValue = try {
Expand All @@ -500,15 +500,18 @@ data class StartBuildContext(
logger.warn("parse repo ref error, key: $key, param: $param")
return originStartParams
}
originStartParams.add(param.copy(value = paramValue))
val cascadeParam = param.copy(value = paramValue)
originStartParams.add(cascadeParam)
// 填充下级参数的[variables.]
fillContextPrefix(cascadeParam, originStartContexts)
CascadePropertyUtils.getCascadeVariableKeyMap(key, param.valueType!!)
.forEach { (subKey, paramKey) ->
val subParam = param.copy(
key = paramKey,
value = paramValue[subKey] ?: ""
)
// 将用户定义的变量增加上下文前缀的版本,与原变量相互独立
originStartParams.add(subParam)
originStartContexts[paramKey] = subParam
// 填充下级参数的[variables.]
fillContextPrefix(subParam, originStartContexts)
}
Expand Down

0 comments on commit f30add6

Please sign in to comment.