Reputation: 11
Are there more examples of custom build JSON payloads beyond that available at https://www.jfrog.com/confluence/display/RTF/Artifactory+REST+API? Or perhaps more in-depth documentation on the “application/vnd.org.jfrog.build.BuildsByName+json” payload?
We have a build that produces both JAR/IVY and RPM files (and some other file types that Artifactory doesn’t really know the content of). Today, we publish those into a generic repository to keep everything together.
What would be ideal is to be able to create my own custom build using the REST API, composed of the JAR files + RPM files, so I can do licensing searches across them.
In the given example, the artifacts composed in the build are referenced by ID/name/hash for reference.
The problem with the current Jenkins/Artifactory/Gradle plugin that we use is that our build is separated amongst many smaller builds, but ultimately, are released as one. This makes making a full report somewhat difficult, and doesn’t have any way for us to easily do license checks including RPM files. We want to be able to publish one build, which contains everything we know in the build.
The current setup also has us uploading our JARs into a Maven repository, which adds time to the builds, given we are also publishing the same content into the Generic repository alongside the RPMS and other content.
Thanks!
Upvotes: 1
Views: 594
Reputation: 621
The build info JSON is fully documented in the README of this repository: https://github.com/JFrogDev/build-info
Which is also the repository the holds the code of the build info engine used by the various JFrog CI/Build plugins. You can definitely create your own BI JSON, and, if you're going to use Java to do that, you should check out this project that demonstrates the usage of the various build info Java APIs:
https://github.com/JFrogDev/project-examples/tree/master/build-info-java-example
Another option you may want to look into is the JFrog CLI, which recently brought support for associating artifact deployment/resolution with a build object and deploying it to Artifactory. This method is completely agnostic to the file types your build produces or the build tool you are using. Have a look at the official documentation here:
Lastly, if you are using Jenkins, the Jenkins Artifactory Plugin now has Pipeline APIs that will allow you to collect artifacts and build information programmatically, and even concatenate multiple build info objects to deploy them as a single build entity to Artifactory, which is pretty wicked. Have a read about this here:
https://wiki.jenkins-ci.org/display/JENKINS/Artifactory+-+Working+With+the+Pipeline+Jenkins+Plugin
Upvotes: 3