I have an artifactory (generic) build in jenkins. It works very well for publishing but I'm having problems with what to write in the spec file for the "download" section.
I want my build to download the latest version of a file from another build. My repo layout is configured so that if I use a url like: http://artiserver:8081/artifactory/infra/package-scripts/[INTEGRATION]/scripts_archive.tar.gz I always get the most recent version of that file.
In the "download file" spec section of the generic artifactory integration job config I can write a spec file like so:
{
"files": [
{
"pattern": "infra/package-scripts/32/scripts_archive.tar.gz"
}
]
}
And this works as expected (always getting the 32
version of the artifact. I want to make the job depends on the latest version (ie, what i get from the INTEGRATION link) eg:
{
"files": [
{
"pattern": "infra/package-scripts/[INTEGRATION]/scripts_archive.tar.gz"
}
]
}
Is this possible? Or do I need my job to depend on a promoted build without the numbering?
--edit--
I've also tried:
{
"files": [
{
"aql": {
"items.find" : {
"repo": "infra",
"name": "scripts_archive.tar.gz",
},
"sort": { "$desc": [ "created" ] },
"limit": 1
}
}
]
}
But get syntax errors..
-- edit 2 --
Turns out I can't yet use sort/limit in jenkins spec file AQL - https://www.jfrog.com/jira/browse/HAP-832