How to compare the revision of a downloaded file vs Artifactory file

79 Views Asked by At

I have a deployment artifact stored in the organization JFrog Artifactory. How do I compare the version of the downloaded artifact vs the file in the Artifactory server?

  1. I have the option to download the artifact.
  2. I have the option to get the info of the artifact in Artifactory.
  3. How do I get the version info of the local artifact that was downloaded?
1

There are 1 best solutions below

4
Amirhossein Taheri On

You can use REST API of JFrog artifactory, for example as in JFrog documentation:

GET /api/search/versions?[g=groupId][&a=artifactId][&v=version][&remote=0/1][&repos=x[,y]]

Sample output:

GET /api/search/versions?g=org.acme&a=artifact&repos=libs-release-local
{
"results": [
    {
        "version": "1.2",
        "integration": false
    },{
        "version": "1.0-SNAPSHOT",
        "integration": true
    },{
        "version": "1.0",
        "integration": false
    }
]
}