Skip to content

Commit 4c2910c

Browse files
authored
RHIDP-6905: Versioning of software templates (#1298)
* Versioning of software template * Incorporated Aleksandr's comments * Incorporated tech comments * Incorporated Gerry's minor comment
1 parent cf72d73 commit 4c2910c

File tree

2 files changed

+45
-0
lines changed

2 files changed

+45
-0
lines changed

assemblies/assembly-configuring-templates.adoc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ include::modules/customizing-templates/ref-creating-templates.adoc[leveloffset=+
1616
include::modules/customizing-templates/proc-creating-a-new-software-component-using-templates.adoc[leveloffset=+1]
1717
include::modules/customizing-templates/proc-searching-and-filtering-software-templates.adoc[leveloffset=+1]
1818
include::modules/customizing-templates/proc-adding-templates.adoc[leveloffset=+1]
19+
include::modules/customizing-templates/proc-versioning-software-templates.adoc[leveloffset=+1]
1920

2021
[role="_additional-resources"]
2122
.Additional resources
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
// Module included in the following assemblies:
2+
//
3+
// * assemblies/assembly-configuring-templates.adoc
4+
5+
:_mod-docs-content-type: PROCEDURE
6+
[id="proc-versioning-software-templates_{context}"]
7+
= Versioning a Software Template in {product}
8+
9+
As a platform administrator, you can version Software Templates by using the existing custom actions `catalog:scaffolded-from` and `catalog:template:version` within the scaffolder backend module. By using these custom actions, you can track the scaffolder template version and the corresponding version of the entities created from it, which improves lifecycle management.
10+
11+
.Prerequisites
12+
13+
* You have administrator rights to {product}.
14+
15+
.Procedure
16+
17+
To add versioning to a Software Template yaml file, complete the following steps:
18+
19+
. Modify the Software Template that you want to update.
20+
. Complete one or both of the following tasks:
21+
* Include the `backstage.io/template-version` annotation in your template. When this annotation is present in your template, it is automatically used to annotate your catalog entity and a default version value is displayed.
22+
* Pass the `backstage.io/template-version` annotation as input to the action. This method takes precedence over the annotation in the template itself. It allows the user running the template to specify the version they wish to generate.
23+
24+
+
25+
[source,yaml]
26+
----
27+
# ...
28+
- id: version-templateRef
29+
name: Append the version of this template to the entityRef
30+
action: catalog:template:version
31+
input:
32+
annotations:
33+
backstage.io/template-version: ${{ parameters.version }}
34+
# ...
35+
----
36+
37+
.Verification
38+
. link:{configuring-book-url}#ref-creating-templates_configuring-templates[Create a catalog component using the updated Software Template]. This step creates a new component in {product-custom-resource-type} and optionally, pushes files to an external repository (For example, GitHub, GitLab).
39+
. Check the component in the Catalog UI.
40+
.. On the *Catalog* page, locate the newly created catalog component.
41+
.. Verify that the `backstage.io/template-version` annotation is present in the entity. You can use *INSPECT ENTITY* and select *YAML Raw* or *JSON Raw* view to find the annotation in the component definition.
42+
. Only if you have published the catalog component: Check the component file in the repository.
43+
.. If *VIEW SOURCE* is present in your UI: Click *VIEW SOURCE* to open the stored component file in the repository.
44+
.. Locate the file manually and verify that the `backstage.io/template-version` annotation is present.

0 commit comments

Comments
 (0)