Save Cache to S3

Updated 2 months ago by Michael Cretzman

Caching ensures faster job execution by reusing the data from expensive fetch operations from previous jobs. 

In Harness CI, you can save the cache to an AWS S3 and restore it later via the Restore Cache in S3 step.

The topic explains how to save cache using the Save Cache option in the S3 step.

In this topic:

Before You Begin

Step 1: Open the Build Stage

In your Harness Pipeline, open the Stage where you want to save the cache.

Step 2: Define the Build Farm Infrastructure

In the CI stage Infrastructure, define the build farm for the codebase.

The following step uses a Kubernetes cluster build farm.

See Define Kubernetes Cluster Build Infrastructure.

Step 3: Save Cache to S3

In Execution, click Add Step, and select Save Cache to S3.

In this step, you are configuring the S3 bucket, keys, and source paths to enable Harness to save the cache to S3.

For step settings, see Save Cache to S3 Settings.

Step 4: Run Pipeline

Click Save to save the changes, and click Run Pipeline

Step 5: View the Results

You can see the logs for the Save Cache to S3 step in the Pipeline as it runs.

level=info name=drone-cache ts=2021-06-25T13:50:01.772227128Z caller=rebuilder.go:93 component=plugin component=rebuilder msg="cache built" took=234.206807ms

See Also


Please Provide Feedback