Kevin Ghadyani
Kevin Ghadyani

Reputation: 7307

Build Monorepo in VSTS only when package changed

When using a monorepo in VSTS, sometimes I only update one package in a commit, not everything. In that case, I only want to run the build for that particular piece and nothing else.

I'm using continuous integration so it will build anytime something is committed to master for instance. Sadly, this build process could take a while and if only one section of the code was modified, I only want to build that project.

Since I'm updating on Git commits, I could be be looking for seeing if changes were made to files in specific directories, but I believe there's gotta be a better way.

NOTE: My project uses Node.js and Webpack and builds using Docker Compose.

Upvotes: 4

Views: 1761

Answers (1)

jessehouwing
jessehouwing

Reputation: 114857

There is a Path Filter on the CI trigger. you can use that to trigger more individual build definitions on the same mono repo.

enter image description here

MsBuild and some other tools offer options for incremental builds. These automatically detect whether files have changed and what projects need to be recompiled. This does require the build to consistently trigger on the same build agent and for the repository and output folders to not be cleaned.

Upvotes: 5

Related Questions