简体   繁体   中英

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. Without using Jenkins plugins I am using curl command. My jfrog artifact format: 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:

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM