jfrog-cli icon indicating copy to clipboard operation
jfrog-cli copied to clipboard

Get list of builds for an artifact

Open krishnamanchikalapudi opened this issue 1 year ago • 1 comments

Hi, Is there a CLI command that will get a list of published builds for an artifact?

krishnamanchikalapudi avatar Apr 30 '24 23:04 krishnamanchikalapudi

@krishnamanchikalapudi Thank you for using the JFrog CLI.

There's a method, which necessitates admin privileges. This ensures that users can't access information without the appropriate permissions.

The approach involves executing AQL through curl:

jf rt curl -X POST /api/search/aql -H "Content-Type: text/plain" -d 'builds.find({"module.artifact.item.name": "artifact-name"}).include("name","number")'

Notice: Without admin privileges, you'll get empty results.

Example results:

{
"results" : [ {
  "build.name" : "Dotnet",
  "build.number" : "1091"
},{
  "build.name" : "Dotnet",
  "build.number" : "1092"
},{
  "build.name" : "Dotnet",
  "build.number" : "1093"
},{
  "build.name" : "Dotnet",
  "build.number" : "1094"
},{
  "build.name" : "Dotnet",
  "build.number" : "1097"
},{
  "build.name" : "Dotnet",
  "build.number" : "1098"
},{
  "build.name" : "Dotnet",
  "build.number" : "1099"
},{
  "build.name" : "Dotnet",
  "build.number" : "1102"
},{
  "build.name" : "Dotnet",
  "build.number" : "1104"
},{
  "build.name" : "Dotnet",
  "build.number" : "1105"
} ],
"range" : {
  "start_pos" : 0,
  "end_pos" : 10,
  "total" : 10,
  "limit" : 100
}
}

Please inform me if that was helpful. Otherwise, if you could provide more details about your specific use case, perhaps we can discover a more suitable solution.

yahavi avatar May 11 '24 15:05 yahavi