将文物存档在詹金斯 [英] Archive the artifacts in Jenkins

查看:139
本文介绍了将文物存档在詹金斯的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有人可以在构建过程中向我解释工件的想法吗?

Could someone please explain to me the idea of artifacts in the build process?

我有一个工作区目录,在其中检出要编译和运行我的ant脚本等的代码.以我为例,最后,我得到一个准备安装的jar文件.那被认为是人工产物吗?

I have the workspace directory where I check out the code to compile and run my ant scripts etc. At the end, in my case, I get a jar file that's ready to install. Is that considered to be the artifact?

我应该告诉我的构建脚本在哪里放置jar文件?在工作区目录中?我的jar文件根据诸如BUILD_ID之类的变量获得唯一的文件名,如何告诉Jenkins选择哪个jar文件?

Where should I tell my build script to put the jar file? In the workspace directory? My jar file gets a unique filename depending on variables like BUILD_ID and such, how can I tell Jenkins which jar file to pick?

好吧,所以我尝试做这样的事情:

Okay, so i tried doing something like this:

该路径在我的工作空间中尚不存在,因为应该由构建脚本来创建它,当然,.jar.properties文件不存在,因为它们尚未生成.那为什么给我一个错误?好像我缺少什么.

The path does not exist yet in my workspace, because the build script is supposed to create it, and of course, the .jar and .properties files are not there because they haven't been generated yet. Why does it give me an error then? Seems like I'm missing something.

此外,Jenkins是否在每次构建后都删除工件(不是归档的工件,我知道我可以告诉它删除那些工件)?否则它将很快阻塞硬盘驱动器.

Also, does Jenkins delete the artifacts after each build (not the archived artifacts, I know I can tell it to delete those)? Otherwise it will clog the hard drive pretty quickly.

推荐答案

您的理解是正确的,詹金斯意义上的工件是构建的结果-构建过程的预期输出.

Your understanding is correct, an artifact in the Jenkins sense is the result of a build - the intended output of the build process.

一个常见的约定是将构建结果放入buildtargetbin目录中.

A common convention is to put the result of a build into a build, target or bin directory.

Jenkins存档器可以使用glob(target/*.jar)轻松提取正确的文件,即使每个构建都具有唯一的名称也是如此.

The Jenkins archiver can use globs (target/*.jar) to easily pick up the right file even if you have a unique name per build.

这篇关于将文物存档在詹金斯的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆