opticyclic
opticyclic

Reputation: 8146

Refer To A Jenkins Parent Workspace From Child

I have a child configuration in Jenkins that can be triggered from 3 separate parent configs.

The purpose of this is to run Sonar on my code. I could add a post build step to each of the parents, but if anything changes I have to change it in 3 places and something is likely to get missed.

Therefore, I can see a few options:

The first option seems to be the lowest on netweork impact (especially as the workspace is very big).

Which of these is possible in Jenkins and how do I do it?

Upvotes: 2

Views: 2255

Answers (1)

Bruno Lavit
Bruno Lavit

Reputation: 10382

I've used the Shared workspace plugin in my Jenkins environment.

My Linux master build a Maven project and I need to share the workspace (with the compiled sources) with a Windows slave to build a MSI package.

You just have to add a post build action on the parent job to compress the workspace (workspace size: around 1GB).

The VMs are in the same physical network and it takes less than 2 minutes to compress the workspace:

01:33:28 Archiving workspace
01:35:15 Deleting old workspace snapshot from #160

Next, the child job can use the parent workspace as a SCM source:

enter image description here

Does it help?

Upvotes: 1

Related Questions