The term “CD” is often ambiguous. Some engineers define it as Continuous Deployment—changes get released automatically, such as into a development environment. Aspect models Continuous Delivery differently: it’s the pipeline step where built artifacts upload to a well-known repository. This repository might be a container registry like Docker Hub, a blob store like AWS S3, or a database. This approach clearly separates CI/CD and Deployment responsibilities:Documentation Index
Fetch the complete documentation index at: https://docs.aspect.build/llms.txt
Use this file to discover all available pages before exploring further.
- The CI/CD pipeline should upload only artifacts that are:
- Configured with BUILD.bazel files.
- Green (proving all relevant tests pass).
- Changed from a previous build.
dev, staging, or prod.
What’s “deliverable?”
A deliverable artifact contains the files to push and the pushing logic that performs the upload. It can also send a message to the deployment system to trigger an auto-deployment of the new artifact. In Bazel terms, a deliverable must be an executable program that you can Bazel run. Examples of deliverable targets include:docker push: Theoci_pushorcontainer_pushrules run withbazel runto push a Docker image to a registry like Docker Hub.git push: Use this when artifacts, such as an SDK, belong in a separate repository.s3 sync: See thes3_syncexample.
Which targets to deliver
Use a Bazel query expression to locate deliverable targets. You have two options to select targets:- Tagging scheme: Choose a scheme, like
tags = ['artifact']. - Rule kinds: Deliver well-known rules, such as
oci_push.
Which changes to deliver
To optimize time and money, deliver only changed targets. This avoids wasting time and resources uploading repeated artifacts. It also ensures release engineers don’t sort through duplicate lists. You can choose changed targets using two approaches:- Predict Changes: Use a
git diffand tools likebazel-diffortarget-determinator. These tools predict what’s affected by version control changes. - Determine Empirically: Find what’s actually different. This requires determinism, so use only unstamped build results (
--nostamp).
bazel-diffis incorrect and may miss affected targets, preventing delivery.target-determinatoris slow. This hurts the service level indicator for releasing hot fixes.- It over-delivers, missing cases where source changes, for example a comment, don’t change the release binary.
ExecutableHash, for example:
Debugging changes to delivered targets
Run theaspect outputs command locally to determine if a source file change creates a new executable.
The results may differ from your expectations. For example:
- Code comments: Changing a comment in a
.gofile doesn’t change the compiler’s output.afile. The executable hash remains unchanged. - External configuration: Changes to production configuration, like Helm charts for Kubernetes deployment, won’t cause a new delivery if they’re not inside the image.
Perform the delivery
Run each deliverable target with stamping enabled. You can do this using a script that reads targets from a manifest file, such as:cat $delivery_manifest | xargs -N1 bazel run --stamp. The Workflows configuration for Continuous Delivery follows the Aspect approach.

