nx-jenkins-build icon indicating copy to clipboard operation
nx-jenkins-build copied to clipboard

Affected builds of the master branch

Open ukslim opened this issue 3 years ago • 1 comments

Thanks for a useful guide.

If I understand this correctly, Jenkins is running nx affected --base=origin/master ... while in the branch being PR'd, so it doesn't build stuff unaffected by the PR. Great. It knows that what's been touched is in the commits that are in this branch and not in master.

But what about building the master branch after a merge? I guess you'd want it to build anything affected by the merge and publish new versions only of affected apps - how to we achieve that in Jenkins?

ukslim avatar Jul 01 '21 10:07 ukslim

@ukslim I found a solution. Merge your PR with a Squash Commit. Afterwards you can run npx nx affected -t build --base=main~1 --head=main on your master branch. Only the changed code will be builded.

tobiasbenkner avatar Oct 05 '23 21:10 tobiasbenkner