Skip to content

Commit fec8fa1

Browse files
committed
Versioning of software template
1 parent c8c5cd3 commit fec8fa1

File tree

2 files changed

+41
-0
lines changed

2 files changed

+41
-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: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
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, modify the `catalog-info.yaml` file of the Software Template you want to update and do either of the following steps:
18+
19+
* Include the `backstage.io/template-version` annotation in your template. When this annotation is present in your template, it will be automatically used to annotate your catalog entity.
20+
21+
* 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.
22+
23+
+
24+
[source,yaml]
25+
----
26+
# ...
27+
- id: version-templateRef
28+
name: Append the version of this template to the entityRef
29+
action: catalog:template:version
30+
input:
31+
annotations:
32+
backstage.io/template-version: ${{ parameters.version }}
33+
# ...
34+
----
35+
36+
.Verification
37+
38+
. link:{configuring-book-url}#ref-creating-templates_configuring-templates[Create a component using the Software Template] that is updated for versioning.
39+
. In the *Catalog* page, select the newly created Software Template and click *VIEW SOURCE*.
40+
. In your GitHub page, go to your `catalog-info.yaml` file and you are able to see `backstage.io/template-version`.

0 commit comments

Comments
 (0)