Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Jenkins build outside of workspace

Tags:

jenkins

hudson

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

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.

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.

like image 793
djs Avatar asked May 17 '11 03:05

djs


People also ask

Does Jenkins delete workspace after build?

The plugin provides a build wrapper (Delete workspace before build starts) and a post build step (Delete workspace when build is done).

How do I change Jenkins workspace location?

So if you wish to change the Jenkins workspace, all you've do is change the path of your JENKINS_HOME. For slave nodes, specify the default workspace on the slave machine in the slave configuration under Manage Jenkins > Manage Nodes > > Configure > Remote FS root.


1 Answers

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)".

like image 153
djs Avatar answered Oct 02 '22 00:10

djs