Writing Templates
In the software catalog, you can see all the templates under the kind
Template. You can create your own templates using a small yaml
definition. It should describe the template and its metadata, along with some input variables that your template requires. Then, add a list of actions that the scaffolding service runs. To learn more about writing templates, see Backstage Documentation.
Using Secrets in Templates
When creating your template, you can add a secret to ensure that all values are protected and inaccessible through the REST endpoint. You can do this by using the built-in ui:field: Secret
.
Also, when adding secrets in existing templates to add secrets, do not use ui:widget: password
with ui:field: Secret
.
fetch: template
action, which prints the secrets in the log and commits the secret value to GitHub directly. The recommended way is only after completing the fetch: template
step, to pass the secret directly to the required service (for example, a Jenkins plug-in). It ensures that the secret is not printed in the logs and can only be accessed from the backend.