This topic describes how to share CI data across Steps and Stages.
Share Data Across Steps
Each Stage has a common
/harness folder. Any Step in the Stage can create, retrieve, update, and delete files in this folder.
You can declare Shared Paths for a Stage. Any Step in the Stage can create, retrieve, update, and delete data in a Shared Path. Suppose you use Maven to manage your software projects. Each Step uses
/root/.m2 as the Maven repository, which is outside the common
/harness folder. This means you need to declare it as a Shared Path in the Pipeline Editor.
To declare a Shared Path, open the Stage, go to the Overview tab, click Shared Paths, and add the subfolder such as
/root/.m2. Once you do this, any Step can then access
Share Data Across Stages
You can share data across Stages using AWS or GCS buckets:
- Save your cache using Save Cache to S3 or Save Cache to GCS.
- Retrieve your cache using Restore Cache from S3 or Restore Cache from GCS.
You cannot share access credentials or other Text Secrets across Stages.For complete end-to-end examples, see the following how-tos: