creating PoC template (unfinished)

This commit is contained in:
evdo 2024-12-03 11:24:31 +01:00
parent d0ee073151
commit f9219c358f
2 changed files with 59 additions and 0 deletions

View file

@ -0,0 +1,59 @@
apiVersion: scaffolder.backstage.io/v1beta3
kind: Template
metadata:
name: example-go-template
title: Example Go template
description: An example template for the scaffolder that creates a simple go service
spec:
owner: user:guest
type: service
parameters:
- title: Fill in some steps
required:
- name
properties:
name:
title: Name
type: string
description: Unique name of the component
ui:autofocus: true
steps:
- id: fetch-template
name: Fetch Template
action: fetch:template
input:
url: ./skeleton
targetPath: ./skeleton
values:
name: ${{ parameters.name }}
- id: publish
name: Publish to Gitea
action: publish:gitea
input:
repoUrl: ghttps://gitea.cnoe.localtest.me:443/giteaAdmin/?repo=${{parameters.name}}
description: This is the repository for ${{ parameters.name }}
sourcePath: ./skeleton
defaultBranch: main
- id: register
name: Register in Catalog
action: catalog:register
input:
repoContentsUrl: ${{ steps['publish'].output.repoContentsUrl }}
- id: trigger-pipeline
name: Trigger Forgejo Pipeline
action: fetch:plain
input:
url: https://gitea.cnoe.localtest.me:443/giteaAdmin/actions/workflows/trigger
method: POST
headers:
Authorization: Bearer ${{ secrets.FORGEJO_API_TOKEN }}
Content-Type: application/json
body: |
{
"ref": "${{ parameters.branchName }}"
}