From c9f55115cf1e81155cf74b83bba1d36011c40708 Mon Sep 17 00:00:00 2001 From: evdo Date: Wed, 15 Jan 2025 15:07:45 +0100 Subject: [PATCH] Added documentation for creation of a backstage template --- .../Backstage/template-creation/_index.md | 80 +++++++++++++++++++ 1 file changed, 80 insertions(+) create mode 100644 docs/technical-documentation/solution/tools/Backstage/template-creation/_index.md diff --git a/docs/technical-documentation/solution/tools/Backstage/template-creation/_index.md b/docs/technical-documentation/solution/tools/Backstage/template-creation/_index.md new file mode 100644 index 0000000..734aeb7 --- /dev/null +++ b/docs/technical-documentation/solution/tools/Backstage/template-creation/_index.md @@ -0,0 +1,80 @@ +## Adding a New Backstage Template to EDPBuilder + +### 1. Clone the Stacks Repository +Clone the stacks repository containing the stacks for edpuilder
+`git clone https://forgejo.edf-bootstrap.cx.fg1.ffm.osc.live/DevFW-CICD/stacks.git` + +### 2. Create a Directory for Your Template +Navigate to the directory:
+`stacks/template/stacks/ref-implementation/backstage-templates/entities` + +Create a new directory for your template within this path. + +### 3. Add a `template.yaml` File +In the newly created template directory, create a file named `template.yaml`. This file will define the steps of your template pipeline. + +Each step in the pipeline must include: +- **Name**: A descriptive name that will be displayed in the Backstage interface. +- **Action**: An action from the list of available Backstage actions. +- **Parameters**: Input parameters required by the action. + +You can view the list of available actions in the Backstage interface at the following URL: +`{address_of_your_backstage}/create/actions` + +#### Example of `template.yaml`: +```yaml +apiVersion: scaffolder.backstage.io/v1beta3 +kind: Template +metadata: + name: my-new-template + title: My New Template + description: A description of the template. +spec: + owner: team@example.com + steps: + - id: fetch + name: Fetch Repository + action: fetch:plain + input: + url: https://github.com/example/repo + - id: log + name: Log Step + action: debug:log + input: + message: "Processing template pipeline" +``` + +### 4. Add a skeleton Directory +Within your template directory, create a subdirectory named skeleton. This is where you can place the files for your template. + +### 5. Update the `catalog-info.yaml` File +To make your new template visible in Backstage, update the `catalog-info.yaml` file located in:
+`stacks/template/stacks/ref-implementation/backstage-templates` + +Add the path to the `template.yaml` file of your new template under the `targets` section. + +#### Example `catalog-info.yaml`: +```yaml +apiVersion: backstage.io/v1alpha1 +kind: Location +metadata: + name: basic-example-templates + description: A collection of example templates +spec: + targets: + - ./basic/template.yaml + - ./argo-workflows/template.yaml + - ./app-with-bucket/template.yaml + - ./demo-go-hello-world/template.yaml + - ./spring-petclinic/template.yaml + - ./my-new-template/template.yaml +--- +apiVersion: backstage.io/v1alpha1 +kind: Location +metadata: + name: basic-organization + description: Basic organization data +spec: + targets: + - ./organization/guests.yaml +``` \ No newline at end of file