The repoContentsUrl output from publish:gitea was missing the branch name. Using catalogInfoUrl with explicit URL construction to fix the 400 error. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
89 lines
2.3 KiB
YAML
89 lines
2.3 KiB
YAML
apiVersion: scaffolder.backstage.io/v1beta3
|
|
kind: Template
|
|
metadata:
|
|
name: node-api-template
|
|
title: API Node.js
|
|
description: Créer une API Node.js avec pipeline CI/CD complet
|
|
tags:
|
|
- nodejs
|
|
- api
|
|
- recommended
|
|
spec:
|
|
owner: rber
|
|
type: service
|
|
|
|
parameters:
|
|
- title: Informations du projet
|
|
required:
|
|
- name
|
|
- description
|
|
- university
|
|
properties:
|
|
name:
|
|
title: Nom du projet
|
|
type: string
|
|
description: Nom unique du projet (minuscules, tirets autorisés)
|
|
pattern: '^[a-z0-9-]+$'
|
|
description:
|
|
title: Description
|
|
type: string
|
|
description: Brève description du projet
|
|
university:
|
|
title: Université
|
|
type: string
|
|
description: Sélectionne ton université
|
|
enum:
|
|
- unstim
|
|
- uac
|
|
- una
|
|
- up
|
|
enumNames:
|
|
- UNSTIM
|
|
- UAC
|
|
- UNA
|
|
- UP
|
|
|
|
- title: Configuration technique
|
|
properties:
|
|
nodeVersion:
|
|
title: Version Node.js
|
|
type: string
|
|
default: "18"
|
|
enum:
|
|
- "18"
|
|
- "20"
|
|
|
|
steps:
|
|
- id: fetch
|
|
name: Générer le code
|
|
action: fetch:template
|
|
input:
|
|
url: ./skeleton
|
|
values:
|
|
name: ${{ parameters.name }}
|
|
description: ${{ parameters.description }}
|
|
university: ${{ parameters.university }}
|
|
nodeVersion: ${{ parameters.nodeVersion }}
|
|
|
|
- id: publish
|
|
name: Publier sur Gitea
|
|
action: publish:gitea
|
|
input:
|
|
repoUrl: git.rber.bj?owner=${{ parameters.university }}&repo=${{ parameters.name }}
|
|
description: ${{ parameters.description }}
|
|
repoVisibility: public
|
|
defaultBranch: main
|
|
|
|
- id: register
|
|
name: Enregistrer dans le catalogue
|
|
action: catalog:register
|
|
input:
|
|
catalogInfoUrl: http://git.rber.bj/${{ parameters.university }}/${{ parameters.name }}/src/branch/main/catalog-info.yaml
|
|
|
|
output:
|
|
links:
|
|
- title: Ouvrir le repository
|
|
url: ${{ steps['publish'].output.remoteUrl }}
|
|
- title: Voir dans le catalogue
|
|
entityRef: ${{ steps['register'].output.entityRef }}
|