As you pointed out, there are quite a few ways to approach this and I think you should go with whatever option you are most familiar with. The central idea is to encapsulate the build steps so that it's easy to execute locally (good for debugging) and can be plugged into whatever CI tool you decide to use - that's the value of this abstraction.