Merge pull request 'Added documentation for creation of a backstage template' (#2) from documentation-backstage-template-creation into development
Reviewed-on: #2
This commit is contained in:
commit
85c51ff021
2 changed files with 81 additions and 0 deletions
|
@ -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<br>
|
||||||
|
`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:<br>
|
||||||
|
`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:<br>
|
||||||
|
`stacks/template/stacks/ref-implementation/backstage-templates`
|
||||||
|
|
||||||
|
Add the path of 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
|
||||||
|
```
|
|
@ -40,6 +40,7 @@ nav:
|
||||||
- Setup Tutorial: technical-documentation/solution/tools/Backstage/backstage-setup-tutorial/_index.md
|
- Setup Tutorial: technical-documentation/solution/tools/Backstage/backstage-setup-tutorial/_index.md
|
||||||
- Existing Plugins: technical-documentation/solution/tools/Backstage/existing-plugins/_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
|
- 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:
|
- CNOE:
|
||||||
- Competitors: technical-documentation/solution/tools/CNOE/competitors/_index.md
|
- Competitors: technical-documentation/solution/tools/CNOE/competitors/_index.md
|
||||||
- Included Backstage Templates:
|
- Included Backstage Templates:
|
||||||
|
|
Loading…
Reference in a new issue