Jenkins在工作空间之外构建

Jenkins在工作空间之外构建

本文介绍了Jenkins在工作空间之外构建的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是Jenkins/Hudson的新手,正在尝试从buildbot迁移基于C make的项目.由于遗留原因,构建系统被硬编码以在版本控制的源代码树(git)之外(在上面的一个目录中)在单独的目录中进行构建.例如:

I am new to Jenkins/Hudson and am trying to migrate a C make-based project from buildbot. For legacy reasons, the build system is hard-coded to build outside of the versioned source tree (git), one directory above, in a separate directory. E.g.:

workspace
  .git
  foo
  bar
build
  artifacts

除了最终会在工作空间之外创建目录这一事实之外,Jenkins不会识别上述build/目录中的项目以将其归档为工件.

Besides the fact that it ends up creating a directory outside the workspace, Jenkins won't recognize items in the build/ directory above to archive as artifacts.

我如何使这种构建系统与Hudson一起使用?在源代码树中构建不是短期的选择.我发现的唯一选择是使用自定义工作区",但是所有这一切都将工作区目录硬编码到其他目录.

How can I make this kind of build system work with Hudson? Building in-source-tree is not a short-term option. The only option I found was "use custom workspace," but all this does it hard-code the workspace directory to some other directory.

推荐答案

要回答我自己的问题:Jenkins git插件中确实有一个选项可以检出到本地子目录,而不是工作区的根目录.使用git插件,单击高级"按钮,然后填写用于回购的本地子目录(可选)"字段.

To answer my own question: there is indeed an option in Jenkins git plugin to check out to a local subdirectory instead of the root of the workspace. With the git plugin, click on the Advanced button and fill in the field "Local subdirectory for repo (optional)".

这篇关于Jenkins在工作空间之外构建的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-16 05:43