简体   繁体   中英

Downloading latest artifacts from artifactory using Bamboo plugin

I am new to artifactory, and have managed to get my artifacts uploaded, using the following filespec:

{
  "files": [
    {
      "target": "generic-local/MyAppName/${bamboo.BUILD_MAJOR}.${bamboo.BUILD_MINOR}.${bamboo.BUILD_STREAM}.${bamboo.buildNumber}/",
      "pattern": "Output/Release/*.*"
    }
  ]
}

This appears to work, I have a project folder, with a folder for each version below it, and the artifacts within.

How can I write an unrelated download task to get the latest build artifacts? By unrelated, I mean no knowledge of the build counters.

Thanks.

If you're uploading files to Artifactory usingFile Specs , you have the option of including these files as part of the build-info, which can also be published to Artifactory. If you're using Bamboo, you just need make sure the "Collect build-info" option is selected in Artifactory Deploy task, and that the Publish Build-Info task is added after ther Artifactory Deploy task.

You can then download these artifacts, using the Artifactory Resolve task, using the following File Spec:

{
  "files": [
    {
      "pattern": "generic-local",
      "build": "the-build-name"
    }
  ]
}

Notice that this spec includes only the repository where the artifacts are in, and the build name. This will download the artifacts of the latest build run published to Artifactory. If you'd like to download the artifacts of a specific build rum, just add the buiod number as follows:

{
  "files": [
    {
      "pattern": "generic-local",
      "build": "the-build-name/the-buil;d-number"
    }
  ]
}

This functionality is not specific to Bamboo only. It is supported by all of JFrog Artifactory's CI integrations . You can read more about File Spechere .

To resolve artifacts from Artifactory, use the Artifactory Generic Resolve task .

In the file spec, use "sortBy" and "limit" to get the latest artifacts.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM