Skip to content

Commit

Permalink
Merge pull request #9676 from royalhuang/issue_6460
Browse files Browse the repository at this point in the history
feat: dispatch 支持上下文占位,动态赋值 #6460
  • Loading branch information
bkci-bot authored Nov 14, 2023
2 parents 59da2a3 + f7332b6 commit c7ed2c4
Showing 1 changed file with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ import com.tencent.devops.common.api.constant.TEMPLATE_ACROSS_INFO_ID
import com.tencent.devops.common.api.exception.DependNotFoundException
import com.tencent.devops.common.api.exception.ExecuteException
import com.tencent.devops.common.api.exception.InvalidParamException
import com.tencent.devops.common.api.util.JsonUtil.deepCopy
import com.tencent.devops.common.log.utils.BuildLogPrinter
import com.tencent.devops.common.pipeline.EnvReplacementParser
import com.tencent.devops.common.pipeline.container.NormalContainer
Expand All @@ -45,6 +46,7 @@ import com.tencent.devops.common.pipeline.pojo.element.agent.ManualReviewUserTas
import com.tencent.devops.common.pipeline.pojo.element.matrix.MatrixStatusElement
import com.tencent.devops.common.pipeline.pojo.element.quality.QualityGateInElement
import com.tencent.devops.common.pipeline.pojo.element.quality.QualityGateOutElement
import com.tencent.devops.common.pipeline.type.DispatchType
import com.tencent.devops.common.redis.RedisOperation
import com.tencent.devops.process.engine.atom.parser.DispatchTypeParser
import com.tencent.devops.process.engine.cfg.ModelContainerIdGenerator
Expand Down Expand Up @@ -297,10 +299,11 @@ class InitializeMatrixGroupStageCmd(
baseOS = customBaseOS ?: modelContainer.baseOS,
vmNames = modelContainer.vmNames,
dockerBuildVersion = modelContainer.dockerBuildVersion,
dispatchType = customDispatchType ?: modelContainer.dispatchType?.let { itd ->
itd.replaceVariable(allContext) // 只处理${{matrix.xxx}}, 其余在DispatchVMStartupTaskAtom处理
itd
},
dispatchType = customDispatchType
?: modelContainer.dispatchType?.deepCopy<DispatchType>()?.let { itd ->
itd.replaceVariable(allContext) // 只处理${{matrix.xxx}}, 其余在DispatchVMStartupTaskAtom处理
itd
},
buildEnv = customBuildEnv ?: modelContainer.buildEnv,
thirdPartyAgentId = modelContainer.thirdPartyAgentId?.let { self ->
EnvReplacementParser.parse(self, allContext, asCodeEnabled, contextPair)
Expand Down

0 comments on commit c7ed2c4

Please sign in to comment.