本文介绍了如何在jenkins中获得工作的相应构建工件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用 hudson.cli.CLI jar 创建Jenkins职位.我在构建后步骤" 部分中选择了归档工件" 选项.它将每个成功构建的工件存档.我正在使用 jenkins远程访问api http://localhost:8080/job/job_name/api/json来获取有关工作的详细信息.和http://localhost:8080/job/job_name/job_number/api/json获取有关内部版本的详细信息.

I create Jenkins jobs using hudson.cli.CLI jar. I have selected "Archive the artifacts" option in the "Post-build steps" section. It archives the artifacts on each succesfull build. I am using jenkins remote access api http://localhost:8080/job/job_name/api/json to get details about jobs. and http://localhost:8080/job/job_name/job_number/api/json to get details about builds.

删除构建时,不会删除相应的归档工件.我想确保将其删除.

When I delete a build corresponding archived artifacts are not deleted. I'd like to make sure that they are deleted.

当我使用jenkins远程访问api http://localhost:8080/job/[job_name]/[job_number]/api/json进行构建时,它将返回json数据,其中包含所有先前已存档的工件(其他成功的构建工件)以及此(运行的构建)工件.如何获得构建的相关工件(成功的构建应返回其工件,而不是所有先前的成功工件).有什么建议或想法吗?

When I use jenkins remote access api http://localhost:8080/job/[job_name]/[job_number]/api/json for a build, it returns json data which contains all previously archived artifacts (other successful builds artifacts) with this (running build) build artifact. How do I get related artifact of a build (a successful build should return its artifact, not all previous successfull artifacts). Any suggestions or ideas ?

推荐答案

我怀疑您没有清理构建之间的工作区,而是存档在那里找到的所有工件,包括先前构建中的工件.

I suspect that you do not clean your workspace between the builds and archive all the artifacts that are found there, including those from previous builds.

这篇关于如何在jenkins中获得工作的相应构建工件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-25 05:29