nx-jenkins-build
nx-jenkins-build copied to clipboard
Affected builds of the master branch
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 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.