We have a set of interconnected library and application Gitlab projects running in Gitlab CI. We have another project that contains the others as submodules (for better or worse) and owns the top-level docker-compose files, developer scripts, as well as the parts of CI/CD pipeline that assemble the libraries and push Docker images that should be deployed.
So far we've spiked out Dagger in a few of the library level projects, but we're about to try the first application one (which depends on some of the libraries and ultimately creates a Docker image). My question is: should Dagger also do the package and/or container deployment steps? Or should I leave that to the existing Gitlab CI jobs?
Our goals are:
- Have local development and CI builds work more or less the same (which Dagger is doing a great job of)
- Have efficient but complete build pipelines from anywhere in the stack, whether local or on CI. If only application level code changes then no libraries should be rebuilt. If a low-level library is changed, projects above should be rebuilt or at least retested.
Our proposed solution:
We have been thinking of keeping steps to push packages and containers to their registries in Gitlab CI since they should never actually be executed in local development and only should be run for protected branches.
But in that case, we still need the local pipelines to get the packages from lower level projects if they're being run on a developer's local machine as part of this top-level project's pipelines. I had been considering some Dagger code that would check those conditions and if they're not in CI, pull them from the build directories in the filesystem.
Does that sound right? Or should I write the deployments into our Dagger code? (Or something else entirely...)