Skip to content

Commit 655c290

Browse files
Merge branch 'main' into addDownloadStarterProject
2 parents 3f4fb80 + 7a90a42 commit 655c290

File tree

10 files changed

+123
-33
lines changed

10 files changed

+123
-33
lines changed

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ Issue tracking repo: https://github.com/devfile/api with label area/registry
66

77
## Build
88

9+
If you want to run the build scripts with Podman, set the environment variable
10+
`export USE_PODMAN=true`
11+
912
To build all of the components together (recommended) for dev/test, run `./build_registry.sh` to build a Devfile Registry index image that is populated with the mock devfile registry data under `tests/registry/`.
1013

1114
Once the container has been pushed, you can push it to a container registry of your choosing with the following commands:

TROUBLESHOOTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Troubelshooting the Devfile Registry
1+
# Troubleshooting the Devfile Registry
22

33
## Collecting Logs
44

build-tools/build.sh

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,13 @@
1+
#!/bin/bash
12
#
2-
# Copyright (c) 2020 Red Hat, Inc.
3+
# Copyright (c) 2020-2022 Red Hat, Inc.
34
# This program and the accompanying materials are made
45
# available under the terms of the Eclipse Public License 2.0
56
# which is available at https://www.eclipse.org/legal/epl-2.0/
67
#
78
# SPDX-License-Identifier: EPL-2.0
89
#
910

10-
#!/bin/bash
11-
12-
# Enable extended globbing in the shell
13-
shopt -s extglob
1411

1512
buildToolsFolder="$(dirname "$0")"
1613
generatorFolder=$buildToolsFolder/../index/generator

build_registry.sh

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
1-
#!/bin/sh
1+
#!/bin/bash
22

33
# This script builds a devfile registry index container image based on the mock devfile registry data under tests/registry
44
# This can be useful if developing components within this repository (such as the index server or build tools)
55
# and want to test all of the components together
6-
6+
shopt -s expand_aliases
77
set -eux
8+
#set the docker alias if necessary
9+
. ./setenv.sh
810

911
# Build the index server base image
10-
./index/server/build.sh
12+
. ./index/server/build.sh
1113

1214
# Build the test devfile registry image
1315
docker build -t devfile-index:latest -f .ci/Dockerfile .

index/generator/schema/schema.go

Lines changed: 92 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -9,42 +9,85 @@ Sample index file:
99
[
1010
{
1111
"name": "java-maven",
12-
"version": "1.1.0",
1312
"displayName": "Maven Java",
1413
"description": "Upstream Maven and OpenJDK 11",
1514
"type": "stack",
1615
"tags": [
1716
"Java",
1817
"Maven"
1918
],
19+
"architectures": [
20+
"amd64",
21+
"arm64",
22+
"s390x"
23+
],
2024
"projectType": "maven",
2125
"language": "java",
22-
"links": {
23-
"self": "devfile-catalog/java-maven:latest"
24-
},
25-
"resources": [
26-
"devfile.yaml"
27-
],
28-
"starterProjects": [
29-
"springbootproject"
26+
"versions": [
27+
{
28+
"version": "1.1.0",
29+
"schemaVersion": "2.1.0",
30+
"default": true,
31+
"description": "Upstream Maven and OpenJDK 11",
32+
"tags": [
33+
"Java",
34+
"Maven"
35+
],
36+
"architectures": [
37+
"amd64",
38+
"arm64",
39+
"s390x"
40+
],
41+
"links": {
42+
"self": "devfile-catalog/java-maven:1.1.0"
43+
},
44+
"resources": [
45+
"devfile.yaml"
46+
],
47+
"starterProjects": [
48+
"springbootproject"
49+
]
50+
}
3051
]
3152
},
3253
{
33-
"name": "java-openliberty",
34-
"version": "0.5.0",
35-
"displayName": "Open Liberty",
36-
"description": "Java application stack using Open Liberty runtime",
54+
"name": "java-quarkus",
55+
"displayName": "Quarkus Java",
56+
"description": "Quarkus with Java",
3757
"type": "stack",
38-
"projectType": "docker",
39-
"language": "java",
40-
"links": {
41-
"self": "devfile-catalog/java-openliberty:latest"
42-
},
43-
"resources": [
44-
"devfile.yaml"
58+
"tags": [
59+
"Java",
60+
"Quarkus"
61+
],
62+
"architectures": [
63+
"amd64"
4564
],
46-
"starterProjects": [
47-
"user-app"
65+
"projectType": "quarkus",
66+
"language": "java",
67+
"versions": [
68+
{
69+
"version": "1.1.0",
70+
"schemaVersion": "2.0.0",
71+
"default": true,
72+
"description": "Quarkus with Java",
73+
"tags": [
74+
"Java",
75+
"Quarkus"
76+
],
77+
"architectures": [
78+
"amd64"
79+
],
80+
"links": {
81+
"self": "devfile-catalog/java-quarkus:1.1.0"
82+
},
83+
"resources": [
84+
"devfile.yaml"
85+
],
86+
"starterProjects": [
87+
"community",
88+
"redhat-product"
89+
]
90+
}
4891
]
4992
}
5093
]
@@ -68,6 +111,7 @@ resources: []string - The file resources that compose a devfile stack.
68111
starterProjects: string[] - The project templates that can be used in the devfile
69112
git: *git - The information of remote repositories
70113
provider: string - The devfile provider information
114+
versions: []Version - The list of stack versions information
71115
*/
72116

73117
// Schema is the index file schema
@@ -90,6 +134,7 @@ type Schema struct {
90134
Git *Git `yaml:"git,omitempty" json:"git,omitempty"`
91135
Provider string `yaml:"provider,omitempty" json:"provider,omitempty"`
92136
SupportUrl string `yaml:"supportUrl,omitempty" json:"supportUrl,omitempty"`
137+
Versions []Version `yaml:"versions,omitempty" json:"versions,omitempty"`
93138
}
94139

95140
// DevfileType describes the type of devfile
@@ -112,6 +157,7 @@ type StarterProject struct {
112157
type Devfile struct {
113158
Meta Schema `yaml:"metadata,omitempty" json:"metadata,omitempty"`
114159
StarterProjects []StarterProject `yaml:"starterProjects,omitempty" json:"starterProjects,omitempty"`
160+
SchemaVersion string `yaml:"schemaVersion,omitempty" json:"schemaVersion,omitempty"`
115161
}
116162

117163
// Git stores the information of remote repositories
@@ -128,3 +174,27 @@ type ExtraDevfileEntries struct {
128174
Samples []Schema `yaml:"samples,omitempty" json:"samples,omitempty"`
129175
Stacks []Schema `yaml:"stacks,omitempty" json:"stacks,omitempty"`
130176
}
177+
178+
// Version stores the top-level stack information defined within stack.yaml
179+
type StackInfo struct {
180+
Name string `yaml:"name,omitempty" json:"name,omitempty"`
181+
DisplayName string `yaml:"displayName,omitempty" json:"displayName,omitempty"`
182+
Description string `yaml:"description,omitempty" json:"description,omitempty"`
183+
Icon string `yaml:"icon,omitempty" json:"icon,omitempty"`
184+
Versions []Version `yaml:"versions,omitempty" json:"versions,omitempty"`
185+
}
186+
187+
// Version stores the information for each stack version
188+
type Version struct {
189+
Version string `yaml:"version,omitempty" json:"version,omitempty"`
190+
SchemaVersion string `yaml:"schemaVersion,omitempty" json:"schemaVersion,omitempty"`
191+
Default bool `yaml:"default,omitempty" json:"default,omitempty"`
192+
Git *Git `yaml:"git,omitempty" json:"git,omitempty"`
193+
Description string `yaml:"description,omitempty" json:"description,omitempty"`
194+
Tags []string `yaml:"tags,omitempty" json:"tags,omitempty"`
195+
Architectures []string `yaml:"architectures,omitempty" json:"architectures,omitempty"`
196+
Icon string `yaml:"icon,omitempty" json:"icon,omitempty"`
197+
Links map[string]string `yaml:"links,omitempty" json:"links,omitempty"`
198+
Resources []string `yaml:"resources,omitempty" json:"resources,omitempty"`
199+
StarterProjects []string `yaml:"starterProjects,omitempty" json:"starterProjects,omitempty"`
200+
}

index/server/build.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
#!/bin/sh
1+
#!/bin/bash
22

33
# Build the index container for the registry
4-
buildfolder="$(realpath $(dirname $0))"
4+
buildfolder="$(realpath $(dirname ${BASH_SOURCE[0]}))"
55

66
# Clone the registry-support repo
77
if [ -d $buildfolder/registry-viewer ]; then

setenv.sh

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#!/bin/bash
2+
3+
# This script aliases the docker cli if the environment variable USE_PODMAN is set to true.
4+
5+
# default value is false if USE_PODMAN is unset or null
6+
podman=${USE_PODMAN:-false}
7+
if [ ${podman} == true ]; then
8+
alias docker=podman
9+
echo "setting alias docker=podman"
10+
fi

tests/integration/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
This folder contains the integration tests for the OCI-based Devfile Registry. The tests can be run against either a remote devfile registry (such as https://registry.stage.devfile.io), or a local devfile registry running your machine (such as in Minikube, or Docker Desktop).
44

55
## Build
6+
If you want to run the build scripts with Podman, set the environment variable
7+
`export USE_PODMAN=true`
68

79
The integration tests can be built to either run in a Docker container, or locally on your machine.
810

tests/integration/docker-build.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
#!/bin/sh
22

3+
#set the docker alias if necessary
4+
. ../../setenv.sh
35
# Get the registry-library
46
cp -rf ../../registry-library ./
57

tests/integration/docker-push.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
#!/bin/sh
2+
3+
#set the docker alias if necessary
4+
. ../../setenv.sh
5+
26
IMAGE_TAG=$1
37
docker tag devfile-registry-integration $IMAGE_TAG
48
docker push $IMAGE_TAG

0 commit comments

Comments
 (0)