Add node-api template
This commit is contained in:
89
templates/node-api/template.yaml
Normal file
89
templates/node-api/template.yaml
Normal file
@@ -0,0 +1,89 @@
|
||||
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 }}
|
||||
defaultBranch: main
|
||||
repoVisibility: internal
|
||||
|
||||
- id: register
|
||||
name: Enregistrer dans le catalogue
|
||||
action: catalog:register
|
||||
input:
|
||||
repoContentsUrl: ${{ steps['publish'].output.repoContentsUrl }}
|
||||
catalogInfoPath: /catalog-info.yaml
|
||||
|
||||
output:
|
||||
links:
|
||||
- title: Ouvrir le repository
|
||||
url: ${{ steps['publish'].output.remoteUrl }}
|
||||
- title: Voir dans le catalogue
|
||||
entityRef: ${{ steps['register'].output.entityRef }}
|
||||
Reference in New Issue
Block a user