diff --git a/index/generator/schema/schema.go b/index/generator/schema/schema.go index adeb72a72..21c5db9ab 100644 --- a/index/generator/schema/schema.go +++ b/index/generator/schema/schema.go @@ -9,7 +9,6 @@ Sample index file: [ { "name": "java-maven", - "version": "1.1.0", "displayName": "Maven Java", "description": "Upstream Maven and OpenJDK 11", "type": "stack", @@ -17,34 +16,78 @@ Sample index file: "Java", "Maven" ], + "architectures": [ + "amd64", + "arm64", + "s390x" + ], "projectType": "maven", "language": "java", - "links": { - "self": "devfile-catalog/java-maven:latest" - }, - "resources": [ - "devfile.yaml" - ], - "starterProjects": [ - "springbootproject" + "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" + ] + } ] }, { - "name": "java-openliberty", - "version": "0.5.0", - "displayName": "Open Liberty", - "description": "Java application stack using Open Liberty runtime", + "name": "java-quarkus", + "displayName": "Quarkus Java", + "description": "Quarkus with Java", "type": "stack", - "projectType": "docker", - "language": "java", - "links": { - "self": "devfile-catalog/java-openliberty:latest" - }, - "resources": [ - "devfile.yaml" + "tags": [ + "Java", + "Quarkus" + ], + "architectures": [ + "amd64" ], - "starterProjects": [ - "user-app" + "projectType": "quarkus", + "language": "java", + "versions": [ + { + "version": "1.1.0", + "schemaVersion": "2.0.0", + "default": true, + "description": "Quarkus with Java", + "tags": [ + "Java", + "Quarkus" + ], + "architectures": [ + "amd64" + ], + "links": { + "self": "devfile-catalog/java-quarkus:1.1.0" + }, + "resources": [ + "devfile.yaml" + ], + "starterProjects": [ + "community", + "redhat-product" + ] + } ] } ] @@ -68,6 +111,7 @@ resources: []string - The file resources that compose a devfile stack. starterProjects: string[] - The project templates that can be used in the devfile git: *git - The information of remote repositories provider: string - The devfile provider information +versions: []Version - The list of stack versions information */ // Schema is the index file schema @@ -90,6 +134,7 @@ type Schema struct { Git *Git `yaml:"git,omitempty" json:"git,omitempty"` Provider string `yaml:"provider,omitempty" json:"provider,omitempty"` SupportUrl string `yaml:"supportUrl,omitempty" json:"supportUrl,omitempty"` + Versions []Version `yaml:"versions,omitempty" json:"versions,omitempty"` } // DevfileType describes the type of devfile @@ -112,11 +157,16 @@ type StarterProject struct { type Devfile struct { Meta Schema `yaml:"metadata,omitempty" json:"metadata,omitempty"` StarterProjects []StarterProject `yaml:"starterProjects,omitempty" json:"starterProjects,omitempty"` + SchemaVersion string `yaml:"schemaVersion,omitempty" json:"schemaVersion,omitempty"` } // Git stores the information of remote repositories type Git struct { - Remotes map[string]string `yaml:"remotes,omitempty" json:"remotes,omitempty"` + Remotes map[string]string `yaml:"remotes,omitempty" json:"remotes,omitempty"` + Url string `yaml:"url,omitempty" json:"url,omitempty"` + RemoteName string `yaml:"remoteName,omitempty" json:"remoteName,omitempty"` + SubDir string `yaml:"subDir,omitempty" json:"subDir,omitempty"` + Revision string `yaml:"revision,omitempty" json:"revision,omitempty"` } // ExtraDevfileEntries is the extraDevfileEntries structure that is used by index component @@ -124,3 +174,27 @@ type ExtraDevfileEntries struct { Samples []Schema `yaml:"samples,omitempty" json:"samples,omitempty"` Stacks []Schema `yaml:"stacks,omitempty" json:"stacks,omitempty"` } + +// Version stores the top-level stack information defined within stack.yaml +type StackInfo struct { + Name string `yaml:"name,omitempty" json:"name,omitempty"` + DisplayName string `yaml:"displayName,omitempty" json:"displayName,omitempty"` + Description string `yaml:"description,omitempty" json:"description,omitempty"` + Icon string `yaml:"icon,omitempty" json:"icon,omitempty"` + Versions []Version `yaml:"versions,omitempty" json:"versions,omitempty"` +} + +// Version stores the information for each stack version +type Version struct { + Version string `yaml:"version,omitempty" json:"version,omitempty"` + SchemaVersion string `yaml:"schemaVersion,omitempty" json:"schemaVersion,omitempty"` + Default bool `yaml:"default,omitempty" json:"default,omitempty"` + Git *Git `yaml:"git,omitempty" json:"git,omitempty"` + Description string `yaml:"description,omitempty" json:"description,omitempty"` + Tags []string `yaml:"tags,omitempty" json:"tags,omitempty"` + Architectures []string `yaml:"architectures,omitempty" json:"architectures,omitempty"` + Icon string `yaml:"icon,omitempty" json:"icon,omitempty"` + Links map[string]string `yaml:"links,omitempty" json:"links,omitempty"` + Resources []string `yaml:"resources,omitempty" json:"resources,omitempty"` + StarterProjects []string `yaml:"starterProjects,omitempty" json:"starterProjects,omitempty"` +} \ No newline at end of file