From c9f55115cf1e81155cf74b83bba1d36011c40708 Mon Sep 17 00:00:00 2001 From: evdo Date: Wed, 15 Jan 2025 15:07:45 +0100 Subject: [PATCH 1/3] 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 From 69fb71b1e4f6ca662037073ff773cdb63e4687f4 Mon Sep 17 00:00:00 2001 From: evdo Date: Wed, 15 Jan 2025 15:41:17 +0100 Subject: [PATCH 2/3] Added documentation for creation of a backstage template --- .../solution/tools/Backstage/template-creation/_index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/technical-documentation/solution/tools/Backstage/template-creation/_index.md b/docs/technical-documentation/solution/tools/Backstage/template-creation/_index.md index 734aeb7..6e7d04b 100644 --- a/docs/technical-documentation/solution/tools/Backstage/template-creation/_index.md +++ b/docs/technical-documentation/solution/tools/Backstage/template-creation/_index.md @@ -51,7 +51,7 @@ Within your template directory, create a subdirectory named skeleton. This is wh 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. +Add the path of the `template.yaml` file of your new template under the `targets` section. #### Example `catalog-info.yaml`: ```yaml From 6427bff9158fe00624796ed2b25614fb9a81101c Mon Sep 17 00:00:00 2001 From: evdo Date: Wed, 15 Jan 2025 15:59:27 +0100 Subject: [PATCH 3/3] Added documentation for creation of a backstage template --- mkdocs.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/mkdocs.yaml b/mkdocs.yaml index 1f515db..f6cbbda 100644 --- a/mkdocs.yaml +++ b/mkdocs.yaml @@ -40,6 +40,7 @@ nav: - Setup Tutorial: technical-documentation/solution/tools/Backstage/backstage-setup-tutorial/_index.md - Existing Plugins: technical-documentation/solution/tools/Backstage/existing-plugins/_index.md - Plugin Creation Tutorial: technical-documentation/solution/tools/Backstage/plugin-creation-tutorial/_index.md + - Template Creation Tutorial: technical-documentation/solution/tools/Backstage/template-creation/_index.md - CNOE: - Competitors: technical-documentation/solution/tools/CNOE/competitors/_index.md - Included Backstage Templates: