Created
March 5, 2016 21:20
-
-
Save caoilte/13a9d59d2635f9d15f71 to your computer and use it in GitHub Desktop.
How to get the latest version of an RPM from an Artifactory Repository
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
echo 'items.find( | |
{ | |
"repo":{"$eq":"<REPO_NAME>"}, | |
"name":{"$match":"<RPM_NAME>*"} | |
} | |
).include("name", "@rpm.metadata.release").sort({"$desc" : ["name"]}).limit(1)' > aql.json | |
curl -X POST -Taql.json --user <USER>:<PASSWORD> "https://<ARTIFACTORY>/api/search/aql" | python -c "import json,sys;obj=json.load(sys.stdin);print obj['results'][0]['properties'][0]['value'];" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment