Skip to content

Commit

Permalink
Merge pull request TencentBlueKing#11230 from carlyin0801/issue_11229…
Browse files Browse the repository at this point in the history
…_atom_target_fix

bug:同一个job下不同语言的java插件生成启动命令时可能会因为系统变量冲突 TencentBlueKing#11229
  • Loading branch information
bkci-bot authored Nov 20, 2024
2 parents 6828ee7 + da1fa79 commit 9182226
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ package com.tencent.devops.worker.common.service.impl

import com.tencent.devops.common.api.enums.OSType
import com.tencent.devops.store.pojo.common.ATOM_POST_ENTRY_PARAM
import com.tencent.devops.worker.common.BK_CI_ATOM_EXECUTE_ENV_PATH
import com.tencent.devops.worker.common.JAVA_PATH_ENV
import com.tencent.devops.worker.common.env.AgentEnv
import com.tencent.devops.worker.common.logger.LoggerService
Expand All @@ -39,6 +38,10 @@ import java.io.File

class JavaAtomRunConditionHandleServiceImpl : AtomRunConditionHandleService {

companion object {
private const val BK_CI_JAVA_ATOM_EXECUTE_ENV_PATH = "BK_CI_JAVA_ATOM_EXECUTE_ENV_PATH"
}

private val logger = LoggerFactory.getLogger(JavaAtomRunConditionHandleServiceImpl::class.java)

override fun prepareRunEnv(
Expand All @@ -63,7 +66,7 @@ class JavaAtomRunConditionHandleServiceImpl : AtomRunConditionHandleService {
javaPath = atomJdkPath
}
}
System.setProperty(BK_CI_ATOM_EXECUTE_ENV_PATH, javaPath)
System.setProperty(BK_CI_JAVA_ATOM_EXECUTE_ENV_PATH, javaPath)
return true
}

Expand All @@ -72,7 +75,7 @@ class JavaAtomRunConditionHandleServiceImpl : AtomRunConditionHandleService {
osType: OSType,
postEntryParam: String?
): String {
val executePath = System.getProperty(BK_CI_ATOM_EXECUTE_ENV_PATH)
val executePath = System.getProperty(BK_CI_JAVA_ATOM_EXECUTE_ENV_PATH)
logger.info(
"handleAtomTarget|target:$target,osType:$osType,postEntryParam:$postEntryParam,executePath:$executePath"
)
Expand Down

0 comments on commit 9182226

Please sign in to comment.