[英]How to download the LATEST artifact from jfrog Artifactory repository to jenkins declarative pipeline without plugin using Curl command?
How to download latest artifacts from jFrog repository.如何从 jFrog 存储库下载最新的工件。 Without using Jenkins plugins I am using curl command.
在不使用 Jenkins 插件的情况下,我使用的是 curl 命令。 My jfrog artifact format: build-156.zip Jenkins Declarative pipeline syntax
我的jfrog神器格式:build-156.zip Jenkins Declarative pipeline syntax
script {
sh "curl -u admin:password@123 'https://<ARTIFACTORY_URL>/path/to/repository/$LATEST_ARTIFACT'"
}
Regarding the artifact one should point to the repo or artifact itself, as is, in groovy:关于神器,应该指向 repo 或神器本身,就像在 groovy 中一样:
def _artifact = sh(script: "curl -X GET http://${URL}:8082/artifactory/${REPOSITORY}/${PLATFORM}/${ENV}/stage/${PROJECT}/${VERSION}/${ARTIFACT} -o ${ARTIFACT}", returnStdout: true).trim()
or with authentication on the command line:或在命令行上进行身份验证:
curl -u admin:xxxx -XGET http://192.168.50.67:8082/artifactory/jfrog-support-bundle/ --output download.zip
Refs: https://www.jfrog.com/confluence/display/JFROG/Artifactory+REST+API#ArtifactoryRESTAPI-RetrieveArtifact参考: https ://www.jfrog.com/confluence/display/JFROG/Artifactory+REST+API#ArtifactoryRESTAPI-RetrieveArtifact
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.