Skip to content

Commit

Permalink
feat:流水线支持归档目录 TencentBlueKing#9320
Browse files Browse the repository at this point in the history
  • Loading branch information
yaoxuwan committed Sep 4, 2023
1 parent 212c539 commit a93a1ba
Showing 1 changed file with 30 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -294,17 +294,38 @@ class BkRepoArchiveFileServiceImpl @Autowired constructor(
registry = dockerRegistry
)
}
} else {
buildGenericFileInfo(it)
}
}

private fun buildGenericFileInfo(nodeInfo: QueryNodeInfo): FileInfo {
// 归档插件归档目录时,在目录多归档一个.bkci_pipeline文件, 记录归档目录的信息
return if (nodeInfo.name == ".bkci_pipeline") {
FileInfo(
name = nodeInfo.name,
fullName = nodeInfo.name,
path = nodeInfo.fullPath,
fullPath = nodeInfo.fullPath,
size = nodeInfo.size,
folder = nodeInfo.folder,
properties = nodeInfo.metadata?.map { m -> Property(m.key, m.value.toString()) },
modifiedTime = LocalDateTime.parse(nodeInfo.lastModifiedDate, DateTimeFormatter.ISO_DATE_TIME)
.timestamp(),
artifactoryType = parseArtifactoryType(nodeInfo.repoName)
)
} else {
FileInfo(
name = it.name,
fullName = it.name,
path = it.fullPath,
fullPath = it.fullPath,
size = it.size,
folder = it.folder,
properties = it.metadata?.map { m -> Property(m.key, m.value.toString()) },
modifiedTime = LocalDateTime.parse(it.lastModifiedDate, DateTimeFormatter.ISO_DATE_TIME).timestamp(),
artifactoryType = parseArtifactoryType(it.repoName)
name = nodeInfo.name,
fullName = nodeInfo.name,
path = nodeInfo.fullPath,
fullPath = nodeInfo.fullPath,
size = nodeInfo.size,
folder = nodeInfo.folder,
properties = nodeInfo.metadata?.map { m -> Property(m.key, m.value.toString()) },
modifiedTime = LocalDateTime.parse(nodeInfo.lastModifiedDate, DateTimeFormatter.ISO_DATE_TIME)
.timestamp(),
artifactoryType = parseArtifactoryType(nodeInfo.repoName)
)
}
}
Expand Down

0 comments on commit a93a1ba

Please sign in to comment.