|
| 1 | +:_mod-docs-content-type: PROCEDURE |
| 2 | + |
| 3 | +[id="proc-configuring-provenance-and-software-template-versioning_{context}"] |
| 4 | += Configuring provenance and Software Template versioning {product} |
| 5 | + |
| 6 | +As a platform engineer, you must modify the Software Template YAML definition to ensure the required provenance information is added during the scaffolding process. |
| 7 | + |
| 8 | +.Prerequisites |
| 9 | + |
| 10 | +* You have administrator rights to {product}. |
| 11 | + |
| 12 | +.Procedure |
| 13 | + |
| 14 | +. Locate the Software Template object YAML file where you want to add the provenance information and add a step that uses the `catalog:scaffolded-from` action. This action links the resulting catalog entity back to the source template. |
| 15 | +. Optional: To track the template version (for example, v1.0 versus v1.5), include the `catalog:template:version` action in the `steps` section. |
| 16 | ++ |
| 17 | +[NOTE] |
| 18 | +==== |
| 19 | +This action reads a version parameter defined in the template and applies it as an annotation to the resulting catalog entity. |
| 20 | +==== |
| 21 | ++ |
| 22 | +[source,yaml] |
| 23 | +---- |
| 24 | +# Example: Adding the versioning action to the steps section |
| 25 | +steps: |
| 26 | + - id: create-version-annotation |
| 27 | + name: Create Template Version Annotation |
| 28 | + action: catalog:template:version |
| 29 | + input: |
| 30 | + templateVersion: ${{ parameters.version }} # Reads the version parameter |
| 31 | + - ... other steps ... |
| 32 | +---- |
| 33 | + |
| 34 | +. Modify the `catalog.rules` and `catalog.locations` sections in your `{product} app-config.yaml` file to register and import the updated Software Template into your {product-very-short} instance. |
| 35 | + |
| 36 | +.Verification |
| 37 | + |
| 38 | +After creating a component with the updated template, verify the provenance annotations in the resulting Catalog Entity YAML. |
| 39 | + |
| 40 | +. In the {product} navigation menu, go to *Catalog* and locate the newly created catalog component. |
| 41 | +. To view the underlying data that links the entity to the template, select the **INSPECT ENTITY** option. |
| 42 | +. To verify provenance annotations, complete the following steps: |
| 43 | +.. Select the *YAML Raw* or *JSON Raw* view and verify the presence of the data item for the `scaffoldedFrom` link. |
| 44 | +.. Optional: If versioning was included, verify the presence of the `backstage.io/template-version` annotation. |
| 45 | ++ |
| 46 | +[NOTE] |
| 47 | +==== |
| 48 | +If you publish the catalog component to an external repository (such as Git), the component file in that repository must also contain the `backstage.io/template-version` annotation. |
| 49 | +==== |
0 commit comments