Search code examples
androidgradleartifactorybuild-systemartifact

How to publish versioned binaries in Artifactory knowing their paths in the repository?


I think I am missing something here, I'll explain what I need to do. We are planning the move to Git, we currently use something else. Git does not deal well with large binaries and we are full of them, so the plan is to move any binary above 10 MB in our repo to an artifact repository, and Artifactory seems pretty nice.

I saw there is a gradle plugin to deal with Artifactory, however I cannot figure out how to achieve what I want, which is really simply said. I have a script which lists every binary file in the repository which is bigger than 10 MB, what I want to do is automate the deployment of these binaries to Artifactory, and I want to version them, since every week some of the binaries is updated because of integrations. The idea is to integrate stuff from other repos, and before pushing the integration work to git, simply run ./gradle publishArtifactory or something like that to get rid of the binaries.

What confuses me is all this Maven and Ivy mumbo-jumbo I encounter when trying to find a solution. What I want is way easier, I don't want Maven, I don't want anything like that, because my binaries are scattered all over not following any directory scheme, what I want is just:

  • My script which lists the binaries, to be run after every integration
  • A gradle task to publish them, handling versions for the binaries which changed since the last publication
  • A gradle task to retrieve all the artifacts in one go, before the build

This is my first time with artifacts repository so sorry if this is a stupid question, to me this solution makes a lot of sense.

Is this even possible? Is there a reason why I cannot find anything this simple? Am I missing something and there are more advanced approaches to this maybe?

Thanks for reading all of this :)


Solution

  • So, in that case, I think that the JFrog CLI will assist you with achieving your goal. As you mentioned, you will have a script that "isolates" those files that are above 10mb.

    On the second step, have JFrog CLI to start recording a build information by writing the following:

    jfrog rt u "files to upload" "path in JFrog Artifactory" --build-name: "yourBuildName" --build-number: 1

    By doing so you are telling JFrog CLI to upload those files AND to collect the data to a JSON format file that will be published to Artifactorys 'Build tab' by running the following command:

    jfrog rt bp "yourBuildName" "yourBuildNumber"

    Please read more on the JFrog CLI working with Artifactory in the below link: https://www.jfrog.com/confluence/display/CLI/CLI+for+JFrog+Artifactory