Save Cache to GCS
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 GCS and restore it later via the Restore Cache from GCS step.
The topic explains how to save cache using the Save Cache option in the GCS step.
In this topic:
- Before You Begin
- Step 1: Open the Build Stage
- Step 2: Define the Build Farm Infrastructure
- Step 3: Save Cache to GCS
- Step 4: Run Pipeline
- Step 5: View the Results
- See Also
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.
Step 3: Save Cache to GCS
In Execution, click Add Step, and select Save Cache to GCS.
In this step, you are configuring the GCS bucket, keys, and source paths to enable Harness to save the cache to GCS.
For step settings, see Save Cache to GCS Step 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 GCS step in the Pipeline as it runs.
level=info name=drone-cache ts=2021-08-16T14:56:44.719403887Z caller=rebuilder.go:93 component=plugin component=rebuilder msg="cache built" took=319.536911ms