Reputation: 4247
We have a very long running build and we are trying to break it down into incremental builds. The code is c#/.net with jenkins as the build manager and TFS (visualstudio online as the source control)
So the architecture would look like:
So the idea is that if code is checked in in Area 1, the associated solutions for only that area are built and the tests for that area are run. We would then also have a nightly build that builds everything.
My question is, is it possible for Jenkins/TFS to detect which area of code has been checked in and pass a variable (or list of variables) into the build script which tells it which items to build/test?
Upvotes: 0
Views: 403
Reputation: 29976
Visual Studio Team Service (Visual Studio Online) supports Git and Team Foundation Version Control(TFVC).
If you are using TFVC for version control, it is possible for VSTS to detect which area of code has been checked in. However, it cannot tell Jenkins which area is updated and to build. So the alternative way would be create three Jenkins jobs for the three area and triggered by three VSTS service hooks.
For example, you have three area in "Test" project, so the folder structure will be:
$/Test
---/Area1
------/Porjects&Solutions
---/Area2
------/Porjects&Solutions
---/Area3
------/Porjects&Solutions
You can create a Jenkins Service Hooks for Area1 as following to trigger the Jenkins job for Area1:
And in the Jenkins, update the setting for Area1 job to just get the source file for Area1:
Now, only when the code in Area1 is checked in, the Jenkins job for Area1 can be triggered. And repeat the steps above to configure the settings for Area2 and Area3.
If you are using Git for version control. There isn't any way to trigger the build by the area folders in the Git repository, you need to separate the three area and put them into three Git repository.
Upvotes: 1