Skip to content

Commit

Permalink
feat:【流水线插件】支持历史大版本下的小版本更新 TencentBlueKing#1841
Browse files Browse the repository at this point in the history
  • Loading branch information
carlyin0801 committed Aug 13, 2021
1 parent 842d4c8 commit e87268a
Showing 1 changed file with 7 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -117,11 +117,10 @@ class StoreCommonServiceImpl @Autowired constructor(
if (dbVersion.isBlank()) {
return requireVersionList
}
val version = if (releaseType != ReleaseTypeEnum.HIS_VERSION_UPGRADE) dbVersion else reqVersion
val versionParts = version.split(".")
val firstVersionPart = versionParts[0]
val secondVersionPart = versionParts[1]
val thirdVersionPart = versionParts[2]
val dbVersionParts = dbVersion.split(".")
val firstVersionPart = dbVersionParts[0]
val secondVersionPart = dbVersionParts[1]
val thirdVersionPart = dbVersionParts[2]
when (releaseType) {
ReleaseTypeEnum.INCOMPATIBILITY_UPGRADE -> {
requireVersionList = listOf("${firstVersionPart.toInt() + 1}.0.0")
Expand All @@ -136,10 +135,10 @@ class StoreCommonServiceImpl @Autowired constructor(
requireVersionList = listOf(dbVersion)
}
ReleaseTypeEnum.HIS_VERSION_UPGRADE -> {
val dbVersionParts = dbVersion.split(".")
val reqVersionParts = reqVersion.split(".")
requireVersionList = listOf(
"${dbVersionParts[0]}.${secondVersionPart.toInt() + 1}.0",
"${dbVersionParts[0]}.$secondVersionPart.${thirdVersionPart.toInt() + 1}"
"${reqVersionParts[0]}.${secondVersionPart.toInt() + 1}.0",
"${reqVersionParts[0]}.$secondVersionPart.${thirdVersionPart.toInt() + 1}"
)
}
else -> {
Expand Down

0 comments on commit e87268a

Please sign in to comment.