RegistryAdding a registry schema

Registry

Adding a registry schema

To add samples and stacks from other repositories, place the extraDevfileEntries.yaml file under the root of a devfile registry.

extraDevfileEntries.yaml schema

Name Type Description
samplesschema[]The sample list.
stacksschemaThe stack list stack or sample attributes.
namestringThe stack name.
displayNamestringThe display name of a devfile.
descriptionstringThe description of a devfile.
tagsstring[]The tags associated to a devfile.
iconstringA devfile icon.
languagestringThe project language that is used in a devfile.
gitgitThe information of remote repositories.
versionsversion[]The information of each stack or sample version.

version schema

Name Type Description
versionstringThe stack version.
schemaVersionstringThe devfile schema version.
defaultbooleanThe default stack version.
gitgitThe information of remote repositories.
descriptionstringThe description of the stack version.
tagsstring[]The tags associated to the stack version.
iconstringIcon of the stack version.
architecturesstring[]The architectures associated to the stack version.

extraDevfileEntries.yaml sample

extraDevfileEntries.yaml
schemaVersion: 2.2.0
samples:
  - name: nodejs-basic
    displayName: Basic Node.js
    description: A simple Hello World Node.js application
    icon: https://nodejs.org/static/images/logos/nodejs-new-pantone-black.svg
    tags: ['NodeJS', 'Express']
    projectType: nodejs
    language: nodejs
    versions:
      - version: 1.1.0
        schemaVersion: 2.2.0
        default: true
        description: nodejs with devfile v2.2.0
        git:
          remotes:
            origin: https://github.com/nodeshift-starters/devfile-sample.git
  - name: code-with-quarkus
    displayName: Basic Quarkus
    description: A simple Hello World Java application using Quarkus
    icon: https://design.jboss.org/quarkus/logo/final/SVG/quarkus_icon_rgb_default.svg
    tags: ['Java', 'Quarkus']
    projectType: quarkus
    language: java
    versions:
      - version: 1.1.0
        schemaVersion: 2.2.0
        default: true
        description: java quarkus with devfile v2.2.0
        git:
          remotes:
            origin: https://github.com/devfile-samples/devfile-sample-code-with-quarkus.git
      - version: 1.0.0
        schemaVersion: 2.0.0
        description: java quarkus with devfile v2.0.0
        git:
          remotes:
            origin: https://github.com/elsony/devfile-sample-code-with-quarkus.git
  - name: java-springboot-basic
    displayName: Basic Spring Boot
    description: A simple Hello World Java Spring Boot application using Maven
    icon: https://spring.io/images/projects/spring-edf462fec682b9d48cf628eaf9e19521.svg
    tags: ['Java', 'Spring']
    projectType: springboot
    language: java
    git:
      remotes:
        origin: https://github.com/devfile-samples/devfile-sample-java-springboot-basic.git
  - name: python-basic
    displayName: Basic Python
    description: A simple Hello World application using Python
    icon: https://www.python.org/static/community_logos/python-logo-generic.svg
    tags: ['Python']
    projectType: python
    language: python
    git:
      remotes:
        origin: https://github.com/devfile-samples/devfile-sample-python-basic.git

The index.json file contains metadata for the stacks and samples in the registry. This metadata is also known as the devfile index schema. From the devfile index schema, you can get the stack and sample generic information such as name, language, and resources.

Devfile index schema

Name Type Description
namestringThe stack name.
versionsversion[]The information of each stack or sample version.
attributesmap[string]apiext.JSONMap of implementation-dependant free-form YAML attributes.
displayNamestringThe display name of a stack.
descriptionstringThe description of a stack.
typeDevfileTypeThe type: stack or sample.
tagsstring[]The tags for a stack.
iconstringA stack icon.
globalMemoryLimitstringA stack global memory limit.
projectTypestringThe project framework that is used in a stack.

version schema

Name Type Description
versionstringThe stack version.
schemaVersionstringThe devfile schema version.
defaultbooleanThe default stack version.
gitgitThe information of remote repositories.
descriptionstringThe description of the stack version.
tagsstring[]The tags associated to the stack version.
iconstringIcon of the stack version.
architecturesstring[]The architectures associated to the stack version.
linksmap[string]stringLinks related to a devfile.
resourcesstring[]The file resources that compose a devfile stack
starterProjectsstring[]The project templates that can be used in a devfile.

Index.json sample

index.json
[
  {
    "name": "go",
    "displayName": "Go Runtime",
    "description": "Stack with the latest Go version",
    "type": "stack",
    "tags": ["Go", "testtag"],
    "icon": "https://raw.githubusercontent.com/devfile-samples/devfile-stack-icons/main/golang.svg",
    "projectType": "go",
    "language": "go",
    "provider": "Red Hat",
    "versions": [
      {
        "version": "1.1.0",
        "schemaVersion": "2.0.0",
        "default": true,
        "description": "Stack with the latest Go version with devfile v2.0.0 schema verison",
        "tags": ["Go"],
        "icon": "https://raw.githubusercontent.com/devfile-samples/devfile-stack-icons/main/golang.svg",
        "links": {
          "self": "devfile-catalog/go:1.1.0"
        },
        "resources": ["devfile.yaml"],
        "starterProjects": ["go-starter"]
      },
      {
        "version": "1.2.0",
        "schemaVersion": "2.1.0",
        "description": "Stack with the latest Go version with devfile v2.1.0 schema verison",
        "tags": ["testtag"],
        "icon": "https://raw.githubusercontent.com/devfile-samples/devfile-stack-icons/main/golang.svg",
        "links": {
          "self": "devfile-catalog/go:1.2.0"
        },
        "resources": ["devfile.yaml"],
        "starterProjects": ["go-starter"]
      }
    ]
  },
  {
    "name": "java-maven",
    "displayName": "Maven Java",
    "description": "Upstream Maven and OpenJDK 11",
    "type": "stack",
    "tags": ["Java", "Maven"],
    "architectures": ["amd64", "arm64", "s390x"],
    "projectType": "maven",
    "language": "java",
    "versions": [
      {
        "version": "1.1.0",
        "schemaVersion": "2.1.0",
        "default": true,
        "description": "Upstream Maven and OpenJDK 11",
        "tags": ["Java", "Maven"],
        "architectures": ["amd64", "arm64", "s390x"],
        "links": {
          "self": "devfile-catalog/java-maven:1.1.0"
        },
        "resources": ["devfile.yaml"],
        "starterProjects": ["springbootproject"]
      }
    ]
  }
]