0
votes

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.

2
Should mention, these are windows executable, no java/maven stuff going on here at all. - user13239021

2 Answers

1
votes

If you're uploading files to Artifactory using File 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 Spec here.

0
votes

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

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