How do I download the latest INTEGRATION verison of an artifactory dependency

IanNorton

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

Eyal Ben Moshe

In version 2.9.0 of the Jenkins Artifactory Plugin, the Download Spec schema was extended to include a new "build" property. This provides you an additional filtering of the downloaded files, so that they are the artifacts of a specific build. If you don't specify a specific build number, you'll get the artifacts of the latest build published to Artifactory. Please notice that the "build" property can provide the latest build and not the latest version, but if your builds publish build-info to Artifactory, then it actually provides the same outcome. Also note that the "pattern" property is still used when specifying the build.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

How can I force Deno to download latest version of a dependency?

How do I tell Maven to use the latest version of a dependency?

How can I download last artifact in Artifactory?

How do I download the latest version of the Android SDK?

Yarn - How do I update each dependency in package.json to the latest version?

How do I update each dependency in package.json to the latest version?

How do I access latest state in useEffect (when updating state) without including dependency

How do I publish Gradle plugins to Artifactory?

How do I delete a repo in artifactory?

How do I download always the latest version of the programs when I use apt-get install [program]?

How do download the latest version of Go

How can I download all artifacts for appended builds in Artifactory?

How do I replace a dependency of a dependency in gradle?

How do I use yum to download software only from Centos 5.4 and not the latest

How do I download an uber jar dependency to a specific local location/folder?

What latest verison of Play! framework should I use when only JDK 1.7 is allowable?

How to find the DRBL verison?

Maven - Always download the latest version of dependency or plugin

How to get the latest artifact from artifactory with no properties

How do I download torrents?

How do I map the largest files\folders in Artifactory

How do I find my Artifactory server ID?

How do I base64 encode a password for JFrog Artifactory?

Can I increase download timeout in Artifactory?

How do I update zsh to the latest version?

How do I install the latest version of Matlab?

How do I install latest Graphviz?

How do I write an NSAlert in latest swift?

How do I update to the latest version of SASS?