Jenkins - 在另一份工作中使用一份工作的结果 [英] Jenkins - Using the results of one job, in another job

查看:31
本文介绍了Jenkins - 在另一份工作中使用一份工作的结果的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个运行 makefile 并生成一些文件的作业.然后我想要另一个将这些文件发布到 ivy 的工作.

I have a job that runs a makefile and generates some files. I then want another job that publishes these files to ivy.

我知道克隆工作区插件,但还有其他选择吗?

I am aware of the clone workspace plugin, but is there any other options?

推荐答案

你运行了一个 Makefile,并且你要发布到 Ivy?

You run a Makefile, and you're publishing to Ivy?

Ivy 是 Ant 的一部分,是一个利用全球 Maven 存储库结构来获取所需 jarfile 和其他依赖项的模块.

Ivy is part of Ant, and is a module that takes advantage of the worldwide Maven repository structure to grab required jarfiles and other dependencies.

别误会,我使用了本地远程 Maven 存储库来发布其他项目将依赖的 C/C++ 库(您可以使用 wget 获取项目).但是,我没有使用 Ivy 做到这一点.

Don't get me wrong, I've used a local remote Maven repository to publish C/C++ libraries (you can use wget to fetch the items) that other projects will depend upon. But, I didn't do that using Ivy.

如果您考虑使用 Apache Ivy,那么您可以使用 Maven 进行发布.有一个 Maven Release 插件可以将您的工件复制到您的 Maven 存储库,但您可能想要做的是部署.

If you're thinking of Apache Ivy, then you can publish using Maven. There's a Maven Release plugin that will copy your artifact to your Maven repository, but what you probably want to do is deploy.

在我的 Jenkins 构建中,我只是让 Jenkins 从命令行执行 maven 的 deploy-file 步骤.这允许我将文件部署到我的 Maven Ivy 存储库中,而无需先创建 pom.xml 文件.(好吧,您无论如何都想创建一个 pom.xml,因为您想包含一个依赖层次结构.)

In my Jenkins builds, I simply had Jenkins execute maven's deploy-file step from the command line. This allowed me to deploy files into my Maven Ivy repository without having to first create a pom.xml file. (Well, you want to create a pom.xml anyway because you want to include a dependency hierarchy.)

我通常在与创建 jar/war/ear 文件的工作相同的工作中执行此操作.但是,如果你想要一个单独的工作来做到这一点,你可以使用 复制神器插件.此插件允许作业 B 从作业 A 复制任何或所有已发布的工件.如果您只想要构建的 jar 文件,这比克隆整个工作区要快得多,也更简单.

I usually did this in the same job as the job that created my jar/war/ear file. However, if you want a separate job to do this, you can use the Copy Artifact Plugin. This plugin allows Job B to copy any or all of the published artifacts from Job A. That's a lot faster and simpler than cloning a whole workspace if you just want the built jar files.

这篇关于Jenkins - 在另一份工作中使用一份工作的结果的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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