From f9219c358ff0e8062d3b62a14d4284b71ca8d0eb Mon Sep 17 00:00:00 2001 From: evdo Date: Tue, 3 Dec 2024 11:24:31 +0100 Subject: [PATCH] creating PoC template (unfinished) --- .../skeleton/manifests/pipeline.yaml | 0 .../entities/template-for-poc/template.yaml | 59 +++++++++++++++++++ 2 files changed, 59 insertions(+) create mode 100644 template/stacks/ref-implementation/backstage-templates/entities/demo-go-hello-world/skeleton/manifests/pipeline.yaml create mode 100644 template/stacks/ref-implementation/backstage-templates/entities/template-for-poc/template.yaml diff --git a/template/stacks/ref-implementation/backstage-templates/entities/demo-go-hello-world/skeleton/manifests/pipeline.yaml b/template/stacks/ref-implementation/backstage-templates/entities/demo-go-hello-world/skeleton/manifests/pipeline.yaml new file mode 100644 index 0000000..e69de29 diff --git a/template/stacks/ref-implementation/backstage-templates/entities/template-for-poc/template.yaml b/template/stacks/ref-implementation/backstage-templates/entities/template-for-poc/template.yaml new file mode 100644 index 0000000..a691918 --- /dev/null +++ b/template/stacks/ref-implementation/backstage-templates/entities/template-for-poc/template.yaml @@ -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 }}" + }