Artifacts
- Last updated on December 29, 2023
- •
- 1 minute to read
Artifacts are files that represent the result of pipeline execution. These files can be print-ready PDFs, designs, images, text files with descriptions, and more.
Artifacts can be temporary or final. Temporary artifacts are used to transfer data from one task to another and are removed after the pipeline is completed. The final artifacts are associated with the project and are only removed with it.
Defining artifacts
To define artifacts for a task, use the inputArtifacts
and outputArtifacts
arrays.
When a task requires input data, you can provide it as follows:
{
"description": "Prepare preview file",
"name": "render preview",
"type": "render-preview",
"inputArtifacts": [
"design"
],
...
}
In this example, we define a design
file in inputArtifacts
to get its preview.
When a task produces data, specify it in the outputArtifacts
. The following example retrieves resources from a project and makes them available for other tasks in the pipeline.
{
"description": "Extract resource from project",
"name": "getting resources",
"type": "extract-project-resource",
"outputArtifacts": [
"resource*"
],
...
}
Finalizing
Every pipeline must conclude with a finalize
task. Within this task, define a finalArtifacts
parameter with names of artifacts we want to make final. Any artifacts not included in this array will be removed after pipeline completion.
{
"description": "Finalize",
"name": "finalizing",
"type": "finalize",
"finalArtifacts": [
"result"
]
}
In the next article, you will learn about Argument interpolation.