Search code examples
githubartifactory

jfrog-cli + github: download latest artifacts from specific (main/default) branch


We would like to run scheduled builds on github using artifacts stored in Artifactory, from github.

I can download the "latest" artifacts using jf rt dl --build "Action Name" --flat but this will also download from feature branches, whoever build last. However, we want to specifically only use the latest artifacts from the main branch only.

Is there a (proper) way of doing this?


Solution

  • You appear to have mixed builds and branches.

    • A branch is a Git phrase that refers to a commit.
    • A build is a CI word for a sequence of instructions that builds and publishes code to Artifactory.

    If the build name in your build contained the branch name, it would immediately meet your need. Take, for example, the following upload command:

    jf rt upload a.txt generic-local/ --build-name="<build-name>-<branch>" --build-number="<build-number>"
    

    Artifactory, as far as I know, does not now support downloading artifacts using VCS information.