Artifact Registry and Continuous Delivery
Learn how to use Artifact Registry with the Continuous Delivery (CD) module to simplify artifact management, ensure traceability, and streamline deployments—especially for use cases like deploying generic artifacts to serverless platforms.
Why Integrate Artifact Registry with Continuous Delivery?
Integrating Harness Artifact Registry (HAR) with CD enables you to:
- Store and version deployment artifacts in a central, secure location.
- Deploy generic artifacts to serverless platforms like AWS Lambda.
- Maintain traceability from artifact creation to deployment.
- Simplify management of deployment assets across environments.
Supported CD Steps
Artifact Registry is supported as a native artifact source in select CD steps. Currently supported:
- AWS Lambda.
Workflow Overview
The following steps show how to deploy a generic artifact to AWS Lambda using Harness CD.
- Step-by-Step
- YAML
1. Upload a Generic Artifact
- Go to your Generic Artifact Registry.
- Click Upload Artifact.
- Select your function file (e.g., ZIP or JAR) and upload it to the registry.
- Note the artifact name and version for later reference.
2. Create or Configure a Service
Follow the Service Creation guide.
Integrated Artifact Sources
Artifact Registry is a native artifact source for CD services.
When creating a service, follow these steps to add a Harness Artifact Registry as your artifact source:
- Under Artifacts, click + Add Artifact Source.
- Choose Harness Artifact Registry as your repository type.
- Enter any name you would like under Artifact Source Identifier.
- Choose your Registry.
- Select your image from the registry. If the image isn't in the registry yet, you can write in the image name as well.
- Enter the image tag or tag regex.
- Optionally, choose the image digest for the specific image/tag combo that you chose.
- Save the service configuration.
3. Configure Your CD Pipeline
- Create or open a CD pipeline.
- Add the service you configured earlier.
- Select the target environment for deployment.
- In the Execution section, add the Deploy AWS Lambda step.
- Fill in the required fields, referencing the uploaded artifact.
- Save and run the pipeline.
4. Run and Review the Pipeline Execution
- Monitor the pipeline execution.
- In Service logs, verify the artifact details used for deployment.
- In the Deploy AWS Lambda step logs, confirm the artifact is downloaded and the deployment succeeds.
# Example Harness CD pipeline YAML using Artifact Registry and AWS Lambda
pipeline:
name: Deploy Generic Artifact to Lambda
identifier: deploy_generic_artifact_to_lambda
stages:
- stage:
name: Deploy to Lambda
identifier: deploy_to_lambda
type: Deployment
spec:
service:
serviceRef: <your_service_identifier>
environment:
environmentRef: <your_environment_identifier>
execution:
steps:
- step:
type: AwsLambdaDeploy
name: Deploy AWS Lambda
identifier: deploy_aws_lambda
spec:
connectorRef: <your_connector_ref>
region: <aws_region>
functionName: <lambda_function_name>
artifact:
type: Harness
spec:
connectorRef: <artifact_registry_connector>
imagePath: <artifact_path>
tag: <artifact_tag>