Building your "Locked Box" Docker image is slow (2-3 minutes). Running your application tests (like composer install) is fast (30 seconds).
The Problem: Building the image on every single code commit is a massive waste of time.
The Solution: We split the work into two separate pipelines:
- Pipeline A: The "Factory" (
image-builder-pipeline.yml)- Job: To build the "Locked Box" (your
php-build-odbimage). - Runs: Very rarely (only when the
Dockerfilechanges). - Output: A compressed
php-build-odb.tar.gzartifact.
- Job: To build the "Locked Box" (your
- Pipeline B: The "Assembly Line" (
azure-pipelines.yml)- Job: To test and deploy your Drupal code.
- Runs: Constantly (on every commit and PR).
- How it works: It skips the Docker build entirely. It just downloads the pre-built "Locked Box" from the Factory, loads it, and uses it to run your tests.
This architecture means your daily pipeline run is minutes faster, as it's only doing the work that's actually changed: testing your code.