Jenkins multiple artifacts for the same build

做~自己de王妃 提交于 2019-12-08 23:03:16

问题


Is there a way to save/archive multiple artifacts from the same build?

Jenkins only allows a single 'Archive the Artifacts' post build step, and grey's out the option after it has been used once.

Maybe the ArtifactsArchiver's allows multiple patterns?


回答1:


You can use Ant-style pattern, e.g. target/*.jar to archive multiple artifacts.

And it is possible to use a comma separated list of patterns if your files can't be matched with one pattern, e.g. target/*.jar, target/*.war.

The ? button next to the input field reveals this info.




回答2:


You can comma separate the paths, like this:

XXX.UnitTests\bin\Release\**.* , XXX.WriteAPI.Service/bin/Release/**.*

Then you get two separate artifacts.

See http://ant.apache.org/manual/Types/fileset.html for details of the Ant Pattern syntax.




回答3:


If you want to save two different types of files like zip files and html files, then you can use

*.html,*.zip

It will help you to archive all zip files and html files in that directory.




回答4:


No, jenkins does not provide only one artifact to save. You can use wild card pattern to same any number of artifacts, For example All Jars - **/*.jar All War - **/*.war and so on.

**/ means Any directory.



来源:https://stackoverflow.com/questions/32823684/jenkins-multiple-artifacts-for-the-same-build

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!