jfrog-cli
jfrog-cli copied to clipboard
Get list of builds for an artifact
Hi, Is there a CLI command that will get a list of published builds for an artifact?
@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.