詹金斯:如何将构建工件推回到源代码管理中? [英] Jenkins: How to push build artifacts back to source control?

查看:111
本文介绍了詹金斯:如何将构建工件推回到源代码管理中?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有OOTB方式可以进行后期构建,以将Jenkins构建的结果推回到(Subversion)存储库?我们使用一个存储库来存储源,使用另一个存储库来记录每次对干线的提交的二进制文件(对调试非常有用).詹金斯(Jenkins)对源SVN存储库的更改完全正常,构建步骤很好,但是现在我们需要下一步".

Is there any OOTB way to get a post build step to push the results of a Jenkins build back to a (Subversion) repository? We use one repository for sources and another to record the binaries for every commit to trunk (very useful for debugging). The Jenkins pull on the source SVN repository change works perfectly, the build step is fine, but now we need the 'what next' step.

一个Python脚本可以很容易地编写返回SVN的代码,前提是它可以找到生成结果的详细信息,但是如何最好地将其与Jenkins集成?我看到了一些有关GIT的帖子/插件,但关于SVN却不多.对于该工作失败的插件,我将使用postbuild-task插件挂接在post-build脚本中.

A Python script to handle the push back to SVN is easy enough to write providing it can find the build result details but how best to integrate this with Jenkins? I see some posts/plugins about GIT, but not so much about SVN. Failing a plugin for the job I'll hook in a post-build script using the postbuild-task plugin.

推荐答案

我不会这样做.没有OOTB解决方案,因为通常认为这是一个糟糕的主意-至少在两个层面上做出承诺: 1.提交派生的工件是次优的 2.提交二进制文件不是最优的

I'd not do this. There isn't an OOTB solution as this would generally be seen as a terrible idea - committing on at least two levels: 1. committing derived artifacts is sub-optimal 2. committing binaries is sub-optimal

但是,如果我绝对有的话,我会设置一个执行二进制提交的作业,该二进制提交与编译作业共享相同的工作空间.我会在编译成功时触发提交作业-该作业可以运行您的脚本(python或调用svn cli的简单bash构建步骤.请确保将编译作业设置为在构建下游作业时阻止,您不希望在提交过程中更改二进制文件.

However if I absolutely had too I'd setup a job that did the binary commit that shared the same workspace as the compile job. I'd' have the commit job triggered on success of the compile - this job could run your script (python, or a simple bash build step that invokes svn cli. Be sure to set the compile job to block when downstream job is building, you wouldn't want the binaries changing during the commit.

这篇关于詹金斯:如何将构建工件推回到源代码管理中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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