我正在使用 Jenkins - Groovy 脚本,向 jfrog 工件上传和下载工件。
以下是上传和下载 zip 文件夹的代码。
stage("Upload Artifact to Jfrog"){
def server = Artifactory.server 'JfrogTAArtifactory'
def uploadSpec = """{
"files": [
{
"pattern": "${env.WORKSPACE}\\${artifactsfoldername}\\API-${env.BUILD_NUMBER}.zip",
"target": "internal-repo/folderName/subFolder/",
"props": "type=zip;status=ready"
}
]
}"""
def buildInfo = server.upload(uploadSpec)
server.publishBuildInfo(buildInfo)
}
stage("Download Artifacts"){
def server = Artifactory.server 'JfrogTAArtifactory'
File folder = new File(downloadArtifactsPath)
FileUtils.cleanDirectory(folder)
def downloadSpec = """{
"files": [
{
"pattern": "internal-repo/folderName/subFolder/API-${env.BUILD_NUMBER}.zip",
"target": "${downloadArtifactsPath}/",
"explode":"true",
"flat": "true"
}
]
}"""
def buildInfo = server.download(downloadSpec)
server.publishBuildInfo(buildInfo)
}
当我尝试下载时,出现以下异常
java.io.IOException: Calculated MD5 checksum is different from original, Original: '09bb61772231822ebd37a2751c818f60' Calculated: '7e32b3f7e8149fbc8013fd7992f345e5'
at org.jfrog.build.extractor.clientConfiguration.util.DependenciesDownloaderHelper.validateMd5Checksum(DependenciesDownloaderHelper.java:439)
谁能帮我?。我是 jenkins 和 Jfrog 的新手