JFrog CLI Offers Fully Reproducible Builds For All

One of the big advantages of running builds through Artifactory is that it stores exhaustive build information generated by the different plugins used with common build tools. This is the “Bill of Materials” that lets you fully reproduce any build even if it has already been deployed to production. It includes everything from artifact versions and dependencies to system properties, environment variables and more.

JFrog CLI Collects Build Info

The good news is that JFrog CLI can now give you this functionality for any build tool by collecting build information and publishing it to Artifactory. All you need to do is download your dependencies through JFrog CLI, and then use it to upload your build output to Artifactory, using the –build-name and –build-number flags.

Let’s consider building a C++ DLL with a Makefile.

One of the first things you need to do is download your dependencies. For this example, let’s assume you’re getting DLLs from a local repository in Artifactory:

> jfrog rt dl "dll-local/*.dll" build-name=myBuild --build-number=1

Note that we specified both the build name and the build number, so that later on, we can associate the dependencies with the build. Once the Makefile has finished the build, you can upload the resulting build output back to Artifactory:

> jfrog rt u "/my-local-path/*.dll" my-repo/path/ --build-name=myBuild --build-number=1

Again, by specifying the build name and number, we now also associated the build output with the build. Now let’s collect and associate all the environment variables in effect when we created the build.

> jfrog rt bce myBuild 1

So at this point, we have all the dependencies, build output and environment variables associated with this specific build. However, to have this bill-of-materials stored, we need to take the final step and publish it to Artifactory:

> jfrog rt bp myBuild 1

That’s all there is to it. You can now see your build information in Artifactory from where you can access the build itself and do any debugging, if needed at any time.

JFrog CLI Build Information in Artifactory

Let’s not forget the other advantages of using JFrog CLI. We already discussed, filespecs and other optimization. In our next posts, we’ll be talking about using JFrog CLI for promotion and distribution; moving builds up the delivery pipeline as they pass the different quality gates, and then finally distributing them out through Artifactory’s distribution repositories to Bintray from where they can be consumed by end users (or devices).

Ready to start collecting build information? Learn more about JFrog CLI.