First Steps with BackstageSchritt 6 von 10: Add a New Repository to the Catalog
Alle Labs

Add a New Repository to the Catalog

It's really easy to add new repositories to the Backstage Catalog from this point on. As we have already configured the GitHub integration in the Catalog, Backstage will automatically scan all repositories in your GitHub organization for files named catalog-info.yaml in the main branch every 5 minutes (as configured earlier). If you want to add a new repository to the Catalog, simply create a new repository in your organization and add a catalog-info.yaml file to the root of the repository.

As we don't want to waste too much time writing source code for this lab, we have provided a simple example repository for you to use. Please fork the repository from https://github.com/tsclabs-eu/lab-backstage-basics into your GitHub organization. This repository contains a simple NodeJS application that will use our template later. After forking the repository, please clone it to your local machine and add a catalog-info.yaml file to the root of the repository with the following content:

apiVersion: backstage.io/v1alpha1
kind: Component
metadata:
  name: backstage-lab
  description: Our main Backstage Demo Repository
  annotations:
    github.com/project-slug: your-github-organization/lab-backstage-basics
spec:
  type: service
  lifecycle: experimental
  owner: your-github-team

Please replace your-github-organization and your-github-team with your actual GitHub organization and team names. After adding the file, commit and push the changes to the main branch of your repository.

After some time (depending on your catalog sync interval), you should see the new repository appearing in the Backstage Catalog. If it doesn't appear, please check the logs of your Backstage application for any errors. You can also restart the application to trigger an immediate sync.

🎉Congratulations

You have successfully added a new repository to the Backstage Catalog! In the next section, we will create a Software Template to bootstrap new repositories in Backstage.