Skip to content

Commit

Permalink
feat: 指定模块统一打包插件 TencentBlueKing#8672
Browse files Browse the repository at this point in the history
  • Loading branch information
fcfang123 committed Oct 18, 2023
1 parent bbfaff0 commit 2622ec6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,19 +36,16 @@ val serviceName = System.getProperty("serviceName")
// 加这个判断 , 主要是为了编译kts时不报错
if (toImage.isNullOrBlank() || (toImageRepo.isNullOrBlank() && toImageTag.isNullOrBlank())) {
val service = serviceName.takeUnless { it.isNullOrBlank() }
?: name.replace("boot-", "")
.replace("-tencent", "")

?: name.replace("boot-", "").replace("-tencent", "")
if (toImage.isNullOrBlank() && !toImageRepo.isNullOrBlank()) {
toImage = toImageRepo.let {
if (toImageRepo.endsWith("/")) it else it + "/"
} + "bkci-" + service + ":" + toImageTag
}

val configNamespace = System.getProperty("config.namespace")

val jvmFlagList = System.getProperty("jvmFlags.file")?.let { File(it).readLines() } ?: emptyList()
val multiModelDataSource = System.getProperty("devops.multi.datasource")

val finalJvmFlags = mutableListOf(
"-server",
"-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=8080",
Expand Down Expand Up @@ -88,7 +85,9 @@ if (toImage.isNullOrBlank() || (toImageRepo.isNullOrBlank() && toImageTag.isNull
it.add("-Ddevops.multi.datasource=$multiModelDataSource")
}
}

finalJvmFlags.addAll(jvmFlagList)

jib {
// 环境变量
container {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ import javax.sql.DataSource
@Configuration
@PropertySource("classpath:/common-db.properties")
@AutoConfigureOrder(Ordered.HIGHEST_PRECEDENCE)
@ConditionalOnMissingClass("com.tencent.devops.AccessoriesJooqConfiguration")
@AutoConfigureBefore(DataSourceAutoConfiguration::class, JooqAutoConfiguration::class)
@Import(DBBaseConfiguration::class)
@EnableTransactionManagement
Expand Down

0 comments on commit 2622ec6

Please sign in to comment.