Skip to content

Commit

Permalink
feat: recipe index文件生成调整TencentBlueKing#2316
Browse files Browse the repository at this point in the history
  • Loading branch information
zacYL committed Sep 11, 2024
1 parent 2eceb2a commit 7a0c8f4
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ import com.tencent.bkrepo.common.artifact.repository.local.LocalRepository
import com.tencent.bkrepo.common.artifact.resolve.response.ArtifactChannel
import com.tencent.bkrepo.common.artifact.resolve.response.ArtifactResource
import com.tencent.bkrepo.common.service.util.SpringContextUtils.Companion.publishEvent
import com.tencent.bkrepo.conan.constant.CONANFILE
import com.tencent.bkrepo.conan.constant.EXPORT_SOURCES_TGZ_NAME
import com.tencent.bkrepo.conan.constant.NAME
import com.tencent.bkrepo.conan.constant.PACKAGE_TGZ_NAME
Expand Down Expand Up @@ -77,7 +78,7 @@ class ConanLocalRepository : LocalRepository() {
override fun onUploadSuccess(context: ArtifactUploadContext) {
super.onUploadSuccess(context)
val fullPath = generateFullPath(context.artifactInfo as ConanArtifactInfo)
if (fullPath.endsWith(EXPORT_SOURCES_TGZ_NAME)) {
if (fullPath.endsWith(CONANFILE)) {
// TODO package version size 如何计算
createVersion(
artifactInfo = context.artifactInfo as ConanArtifactInfo,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,11 @@

package com.tencent.bkrepo.conan.pojo

import java.util.SortedSet

class IndexInfo(
var reference: String,
var revisions: MutableList<RevisionInfo> = mutableListOf()
var revisions: SortedSet<RevisionInfo> = sortedSetOf()
) {
fun addRevision(revisionInfo: RevisionInfo) {
val exist = revisions.firstOrNull { revisionInfo.revision == it.revision }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ class ConanServiceImpl : ConanService {
override fun getRecipeRevisions(conanArtifactInfo: ConanArtifactInfo): IndexInfo {
with(conanArtifactInfo) {
val conanFileReference = convertToConanFileReference(conanArtifactInfo)
commonService.checkNodeExist(projectId, repoName, buildReference(conanFileReference))
commonService.checkNodeExist(projectId, repoName, buildPackagePath(conanFileReference))
return commonService.getRecipeRevisions(projectId, repoName, conanFileReference)
}
}
Expand Down

0 comments on commit 7a0c8f4

Please sign in to comment.