简体   繁体   中英

Artifactory REST API: How to generate Build Info json

I'm trying to generate within a build job a JSON build info file to upload to Artifactory and create a trace-ability between the two tools. However the regular Jenkins JSON API file is not in the correct design, therefore I need to generate a new one while running a job. The question is simple, how do I do that? Is there some specific plugin(tool) I need to add to Jenkins, or perhaps just a simple set of commands will do the work?

Thanks in advance!

您可以使用此示例演示如何轻松地将构建信息创建和部署到Artifactory中。

I'd suggest generating the BuildInfo JSON in a separate script, not from Jenkins itself. Jenkins will just call that script and pass all the info about the build environment (like build name, build number and other environment variables).

And here's an example of how you can generate the BuildInfo .

You can use Artifactory Jenkins plugin .

This will do exactly what you want (If you are not using Java build tools like Maven, Gradle or Ivy use freestyle job and choose "Generic integration").

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM