ch007m / my-backstage-templates

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

My backstage templates

This is what you should do to use the templates of this project in your backstage application:

Create (or use an existing) backstage application (>= 1.25):

npx @backstage/create-app
Need to install the following packages:
@backstage/create-app@0.5.14
Ok to proceed? (y) y
? Enter a name for the app [required] my-backstage
...
cd my-backstage

Add to your app-config.local.yaml file (or create it) the url pointing to this repo using the catalog.locations field:

cat <<EOF > app-config.local.yaml
# my-backstage local config
catalog:
  import:
    entityFilename: catalog-info.yaml
  rules:
    - allow: [Component,System,API,Resource,Location,Template,Group,User]
  locations:
    # My backstage templates
    - type: url
      target: https://github.com/ch007m/my-backstage-templates/blob/main/all.yaml
EOF

Launch backstage: yarn dev

Gitea template

Description: To create a gitea repository (public or private) on a local gitea.localtest.me:3333 server.

Template file

Instructions:

  • Have the gitea plugin @backstage/plugin-scaffolder-backend-module-gitea registered within your packages/backend. See the plugin page for more information README.md
  • Install and run a local gitea server.
  • Add the following integrations to the app-config.local.yaml file
integrations:
  gitea:
  - host: gitea.localtest.me:3333
    username: "gitea_admin"
    password: "gitea_admin"

Dummy template

Description: Simple template to test field and debug using the action debug:log

Template file

  steps:
    - id: debug
      name: debug
      action: debug:log
      input:
        message: ${{ parameters.myInput | base64 }}

Custom parameter pipe filters

Description: Template to play with a custom Template Filter able to base64 a template's field ${{ parameters.myInput | base64 }}. The filter(s) are backed by a Backend module (aka external plugin) loaded by the new backend system using backend.add(import('@internal/backend-module-scaffolder-my-custom-filter')).

Remark: This template will validate the doc that we will develop according to this ticket 24002 using the instructions: https://github.com/ch007m/backstage-backend-module?tab=readme-ov-file#howto-guide-backend-module-and-template-filter

Template file

  steps:
    - id: debug
      name: debug
      action: debug:log
      input:
        message: ${{ parameters.myInput | base64 }}

About

License:Apache License 2.0