2 ms·
It was a bit hacky, but we've basically implemented some of the stuff in [1] to achieve incremental builds. If a pr changes projects a,b,c and not x,y,z then it
by DanFeldman 7y ago
It was a bit hacky, but we've basically implemented some of the stuff in [1] to achieve incremental builds. If a pr changes projects a,b,c and not x,y,z then it will only build a,b,c. But it's not truly incremental right now, as it won't test things that depend on A/B/C.
We have plans to use Bazel in the future, but you have to boil the ocean when moving to bazel and get everything ever inside bazel before you get any benefit out of it.
Jenkins can't do it "easily" but it definitely can. I'd be happy to share our Jenkinsfile if you'd like.
Our finding of changes is something like:
#!/bin/bash
set -euxo pipefail
COMPARE_BRANCH=$1
MERGE_BASE=`git merge-base $COMPARE_BRANCH HEAD`
FILES_CHANGED=$(git diff --name-only $MERGE_BASE | grep '/')
echo ${FILES_CHANGED} | xargs dirname | cut -d "/" -f 1 | sort | uniq
[1] blog.shippable.com/ci/cd-of-microservices-using-mono-repos