docs: revamp the intro to software templates section

Signed-off-by: Peter Macdonald <peterm4c@pm.me>
This commit is contained in:
Peter Macdonald
2025-04-12 16:42:55 +02:00
parent 208d46983d
commit 4b746a347c
13 changed files with 34 additions and 28 deletions
Binary file not shown.

Before

Width:  |  Height:  |  Size: 652 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 599 KiB

After

Width:  |  Height:  |  Size: 1.4 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 786 KiB

After

Width:  |  Height:  |  Size: 1.2 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 210 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 665 KiB

After

Width:  |  Height:  |  Size: 1.4 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 776 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 586 KiB

After

Width:  |  Height:  |  Size: 1.1 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 607 KiB

After

Width:  |  Height:  |  Size: 1.1 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 607 KiB

After

Width:  |  Height:  |  Size: 1.1 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 201 KiB

After

Width:  |  Height:  |  Size: 1.4 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 166 KiB

After

Width:  |  Height:  |  Size: 1.1 MiB

+34 -28
View File
@@ -17,9 +17,6 @@ locations like GitHub or GitLab.
## Getting Started
> Be sure to have covered
> [Getting Started with Backstage](../../getting-started) before proceeding.
:::note Note
If you're running Backstage with Node 20 or later, you'll need to pass the flag `--no-node-snapshot` to Node in order to
@@ -27,12 +24,17 @@ use the templates feature.
One way to do this is to specify the `NODE_OPTIONS` environment variable before starting Backstage:
`export NODE_OPTIONS="${NODE_OPTIONS:-} --no-node-snapshot"`
> It's important to append to the existing `NODE_OPTIONS` value, if it's already set, rather than overwriting it, since some NodeJS Debugging tools may rely on this environment variable to work properly.
It's important to append to the existing `NODE_OPTIONS` value, if it's already set, rather than overwriting it, since some NodeJS Debugging tools may rely on this environment variable to work properly.
:::
The Software Templates are available under `/create`. For local development you
should be able to reach them at `http://localhost:3000/create`.
These docs assume you have already gone over the [Backstage Getting Started](../../getting-started) section.
## The Templates page
Software Templates you have imported into Backstage can be found under `/create`.
If you're running Backstage locally, this will be `http://localhost:3000/create`.
Once there, you should see something that looks similar to this:
@@ -47,25 +49,32 @@ internally.
![Enter some variables](../../assets/software-templates/template-picked.png)
After filling in these variables, you'll get some more fields to fill out which
are required for Backstage usage: the owner (which is a `user` in the backstage
system), and the `storePath` which is a destination URL to create for the
provider, for instance `https://github.com/backstage/my-new-repository`, or
`https://gitlab.com/myorg/myrepo`.
Templates generally consist of a set of steps, and each step can have its own set of required or optional inputs, as you can see in the image below we are now prompted to input some Github repository information.
![Enter Backstage vars](../../assets/software-templates/template-picked-2.png)
## Run!
## Review page
Once you've entered values and confirmed, you'll then get a popup box with live
progress of what is currently happening with the creation of your template.
Before you run the template, you'll be taken to a summary page where you can verify the inputs you have provided before we run the template.
This is a good time to double check that you have provided the correct information and allows you to go back and change any of the inputs if you need to.
![Review](../../assets/software-templates/review.png)
## Run the template
Once you are happy with the inputs you have provided, you can click on the `Create` button to run the template.
![Templating Running](../../assets/software-templates/running.png)
It shouldn't take too long, and you'll have a success screen!
## Success
Once the template has finished running, you'll be taken to a success page where you can see the results of the template.
![Templating Complete](../../assets/software-templates/complete.png)
## Failure
If it fails, you'll be able to click on each section to get the log from the
step that failed which can be helpful in debugging.
@@ -75,23 +84,14 @@ only if it supports it.
![Templating failed](../../assets/software-templates/failed.png)
## View Component in Catalog
## View the Results
When it's been created, you'll see the `View in Catalog` button, which will take
you to the registered component in the catalog:
![Catalog](../../assets/software-templates/go-to-catalog.png)
And then you'll also be able to see it in the Catalog View table:
![Catalog](../../assets/software-templates/added-to-the-catalog-list.png)
Once the template has finished running, and from the screenshot above, when its successful, you are presented with two links, clicking on them will take you to the templated repository we created!
## Disable Register Existing Component button
There could be situations where you would like to disable the
`Register Existing Component` button for your users. For example:
![Disable Button](../../assets/software-templates/disable-register-existing-component-button.png)
`Register Existing Component` button for your users.
To do so, you need to explicitly disable the default route binding from the `scaffolderPlugin.registerComponent` to the Catalog Import page.
@@ -120,12 +120,14 @@ app:
After the change, you should no longer see the button.
## Previewing and Executing Previous Template Tasks
## Template Task List
Each execution of a template is treated as a unique task, identifiable by its own unique ID. To view a list of previously executed template tasks, navigate to the "Create" page and access the "Task List" from the context menu (represented by the vertical ellipsis, or 'kebab menu', icon in the upper right corner).
![Template Task List](../../assets/software-templates/template-task-list.png)
## Starting Over
If you wish to re-run a previously executed template, navigate to the template tasks page. Locate the desired task and select the "Start Over" option from the context menu.
![Template Start Over](../../assets/software-templates/template-start-over.png)
@@ -133,3 +135,7 @@ If you wish to re-run a previously executed template, navigate to the template t
This action will initiate a new execution of the selected template, pre-populated with the same parameters as the previous run, but these parameters can be edited before re-execution.
In the event of a failed template execution, the "Start Over" option can be used to re-execute the template. The parameters from the original run will be pre-filled, but they can be adjusted as needed before retrying the template.
## Want to see it in action?
The [Backstage Demo Site](https://demo.backstage.io/) has a template you are able to run, which is where the screenshots in this document were taken from!