diff --git a/index/server/README.md b/index/server/README.md
new file mode 100644
index 000000000..50123cd41
--- /dev/null
+++ b/index/server/README.md
@@ -0,0 +1,26 @@
+# Devfile registry index server
+
+## Overview
+
+Provides REST API support for devfile registries and serves [devfile registry viewer](https://github.com/devfile/registry-viewer) client.
+
+For more information on REST API docs: [registry-REST-API.adoc](registry-REST-API.adoc)
+
+## Testing
+
+Endpoint unit testing is defined under `pkg/server/endpoint_test.go` and can be performed by running the following:
+
+```sh
+go test pkg/server/endpoint_test.go
+```
+
+or by running all tests:
+
+```sh
+go test ./...
+```
+
+**Environment Variables**
+
+- `DEVFILE_REGISTRY`: Optional environment variable for specifying testing registry path
+ - default: `../../tests/registry`
diff --git a/index/server/go.mod b/index/server/go.mod
index 8b463e5b5..0096e4e35 100644
--- a/index/server/go.mod
+++ b/index/server/go.mod
@@ -11,6 +11,7 @@ require (
github.com/gin-gonic/gin v1.7.7
github.com/hashicorp/go-version v1.4.0
github.com/kylelemons/godebug v0.0.0-20170820004349-d65d576e9348
+ github.com/opencontainers/go-digest v1.0.0-rc1
github.com/opencontainers/image-spec v1.0.1
github.com/prometheus/client_golang v1.11.0
golang.org/x/text v0.3.6
@@ -64,7 +65,6 @@ require (
github.com/mitchellh/reflectwalk v1.0.1 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.1 // indirect
- github.com/opencontainers/go-digest v1.0.0-rc1 // indirect
github.com/peterbourgon/diskv v2.0.1+incompatible // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/prometheus/client_model v0.2.0 // indirect
diff --git a/index/server/go.sum b/index/server/go.sum
index c68f78aa7..0e44b1a67 100644
--- a/index/server/go.sum
+++ b/index/server/go.sum
@@ -140,8 +140,6 @@ github.com/devfile/api/v2 v2.0.0-20220117162434-6e6e6a8bc14c h1:sjghKUov/WT71dBr
github.com/devfile/api/v2 v2.0.0-20220117162434-6e6e6a8bc14c/go.mod h1:d99eTN6QxgzihOOFyOZA+VpUyD4Q1pYRYHZ/ci9J96Q=
github.com/devfile/library v1.2.1-0.20220308191614-f0f7e11b17de h1:jImHtiAxjyul1UkPmf6C3EMS5wqNz+k84LKkCXkeqws=
github.com/devfile/library v1.2.1-0.20220308191614-f0f7e11b17de/go.mod h1:GSPfJaBg0+bBjBHbwBE5aerJLH6tWGQu2q2rHYd9czM=
-github.com/devfile/registry-support/index/generator v0.0.0-20220316161530-f06d84c42b54 h1:k7F4Hc4svkA+qHerBTZzcU1iVrQAJHOh8KurPnL4uYk=
-github.com/devfile/registry-support/index/generator v0.0.0-20220316161530-f06d84c42b54/go.mod h1:1fyDJL+fPHtcrYA6yjSVWeLmXmjCNth0d5Rq1rvtryc=
github.com/devfile/registry-support/index/generator v0.0.0-20220624203950-e7282a4695b6 h1:bTbZxKSjF9xfiUuOKpoyX7P/ZcnIRy993+JBvkQ91hw=
github.com/devfile/registry-support/index/generator v0.0.0-20220624203950-e7282a4695b6/go.mod h1:1fyDJL+fPHtcrYA6yjSVWeLmXmjCNth0d5Rq1rvtryc=
github.com/dgrijalva/jwt-go v0.0.0-20170104182250-a601269ab70c/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ=
diff --git a/index/server/pkg/ocitest/ocitest.go b/index/server/pkg/ocitest/ocitest.go
new file mode 100644
index 000000000..81b1a40a4
--- /dev/null
+++ b/index/server/pkg/ocitest/ocitest.go
@@ -0,0 +1,127 @@
+package ocitest
+
+import (
+ "encoding/json"
+ "fmt"
+ "log"
+ "net"
+ "net/http"
+ "net/http/httptest"
+
+ "github.com/gin-gonic/gin"
+)
+
+// ResponseError repersents an error returned in an errors response by an OCI server,
+// see https://github.com/opencontainers/distribution-spec/blob/main/spec.md#error-codes
+type ResponseError struct {
+ Code string `json:"code"` // Error code
+ Message string `json:"message"` // Error Message
+ Detail map[string]interface{} `json:"detail"` // Additional detail on the error (optional)
+}
+
+// MockOCIServer is an entity for mocking an OCI server
+// for testing. At the moment, this is only needed for
+// the devfile registry index server endpoint testing,
+// however, this entity could be used in a testing scenario
+// where an OCI server is needed.
+//
+// More on the OCI server specification, see https://github.com/opencontainers/distribution-spec/blob/main/spec.md
+type MockOCIServer struct {
+ httpserver *httptest.Server // Test server entity
+ router *gin.Engine // Router engine for route management
+ ServeManifest func(c *gin.Context) // Handler for serving a manifest for a blob
+ ServeBlob func(c *gin.Context) // Handler for serving a blob from the OCI server
+}
+
+// servePing is a custom handler to test if
+// MockOCIServer is listening for requests
+func servePing(c *gin.Context) {
+ data, err := json.Marshal(gin.H{
+ "message": "ok",
+ })
+ if err != nil {
+ log.Fatal(err)
+ }
+
+ c.JSON(http.StatusOK, data)
+}
+
+// WriteErrors writes error response object for OCI server
+// errors
+func WriteErrors(errors []ResponseError) map[string]interface{} {
+ return gin.H{
+ "errors": errors,
+ }
+}
+
+// NewMockOCIServer creates a MockOCIServer entity
+func NewMockOCIServer() *MockOCIServer {
+ gin.SetMode(gin.TestMode)
+
+ mockOCIServer := &MockOCIServer{
+ // Create router engine of mock OCI server
+ router: gin.Default(),
+ }
+
+ // Create mock OCI server using the router engine
+ mockOCIServer.httpserver = httptest.NewUnstartedServer(mockOCIServer.router)
+
+ return mockOCIServer
+}
+
+// Start listening on listenAddr for requests to the MockOCIServer
+func (server *MockOCIServer) Start(listenAddr string) error {
+ // Testing Route for checking mock OCI server
+ server.router.GET("/v2/ping", servePing)
+
+ // Pull Routes, see https://github.com/opencontainers/distribution-spec/blob/main/spec.md#pull
+ // Fetch manifest routes
+ if server.ServeManifest != nil {
+ server.router.GET("/v2/devfile-catalog/:name/manifests/:ref", server.ServeManifest)
+ server.router.HEAD("/v2/devfile-catalog/:name/manifests/:ref", server.ServeManifest)
+ }
+
+ // Fetch blob routes
+ if server.ServeBlob != nil {
+ server.router.GET("/v2/devfile-catalog/:name/blobs/:digest", server.ServeBlob)
+ server.router.HEAD("/v2/devfile-catalog/:name/blobs/:digest", server.ServeBlob)
+ }
+
+ l, err := net.Listen("tcp", listenAddr)
+ if err != nil {
+ return fmt.Errorf("unexpected error while creating listener: %v", err)
+ }
+
+ server.httpserver.Listener.Close()
+ server.httpserver.Listener = l
+
+ server.httpserver.Start()
+
+ return nil
+}
+
+// Close the MockOCIServer connection
+func (server *MockOCIServer) Close() {
+ server.httpserver.Close()
+}
+
+// ProxyRecorder is an extension of the ResponseRecorder
+// struct within httptest with an additional receiver CloseNotifier
+// which is needed for testing the proxy route to the OCI server
+type ProxyRecorder struct {
+ *httptest.ResponseRecorder
+ http.CloseNotifier
+}
+
+// NewProxyRecorder creates a new ProxyRecorder entity
+func NewProxyRecorder() *ProxyRecorder {
+ return &ProxyRecorder{
+ ResponseRecorder: httptest.NewRecorder(),
+ }
+}
+
+// CloseNotify creates a bool channel for notifying a
+// closure of a request
+func (rec *ProxyRecorder) CloseNotify() <-chan bool {
+ return make(<-chan bool)
+}
diff --git a/index/server/pkg/server/constants.go b/index/server/pkg/server/constants.go
index e35878ba0..0e1c1da08 100644
--- a/index/server/pkg/server/constants.go
+++ b/index/server/pkg/server/constants.go
@@ -8,18 +8,19 @@ import (
const (
// Constants for resource names and media types
- archiveMediaType = "application/x-tar"
- archiveName = "archive.tar"
- devfileName = "devfile.yaml"
- devfileNameHidden = ".devfile.yaml"
- devfileConfigMediaType = "application/vnd.devfileio.devfile.config.v2+json"
- devfileMediaType = "application/vnd.devfileio.devfile.layer.v1"
- pngLogoMediaType = "image/png"
- pngLogoName = "logo.png"
- svgLogoMediaType = "image/svg+xml"
- svgLogoName = "logo.svg"
- vsxMediaType = "application/vnd.devfileio.vsx.layer.v1.tar"
- vsxName = "vsx"
+ archiveMediaType = "application/x-tar"
+ archiveName = "archive.tar"
+ starterProjectMediaType = "application/zip"
+ devfileName = "devfile.yaml"
+ devfileNameHidden = ".devfile.yaml"
+ devfileConfigMediaType = "application/vnd.devfileio.devfile.config.v2+json"
+ devfileMediaType = "application/vnd.devfileio.devfile.layer.v1"
+ pngLogoMediaType = "image/png"
+ pngLogoName = "logo.png"
+ svgLogoMediaType = "image/svg+xml"
+ svgLogoName = "logo.svg"
+ vsxMediaType = "application/vnd.devfileio.vsx.layer.v1.tar"
+ vsxName = "vsx"
scheme = "http"
registryService = "localhost:5000"
diff --git a/index/server/pkg/server/endpoint.go b/index/server/pkg/server/endpoint.go
index 8f6f11556..20a614db1 100644
--- a/index/server/pkg/server/endpoint.go
+++ b/index/server/pkg/server/endpoint.go
@@ -289,7 +289,7 @@ func serveDevfileStarterProjectWithVersion(c *gin.Context) {
}
c.Header("Content-Disposition", fmt.Sprintf("attachment; filename=\"%s.zip\"", starterProjectName))
- c.Data(http.StatusAccepted, "application/zip", downloadBytes)
+ c.Data(http.StatusAccepted, starterProjectMediaType, downloadBytes)
}
}
@@ -521,6 +521,7 @@ func fetchDevfile(c *gin.Context, name string, version string) ([]byte, indexSch
if devfileIndex.Type == indexSchema.StackDevfileType {
bytes, err = pullStackFromRegistry(foundVersion)
if err != nil {
+ log.Print(err.Error())
c.JSON(http.StatusInternalServerError, gin.H{
"error": err.Error(),
"status": fmt.Sprintf("Problem pulling version %s from OCI Registry", foundVersion.Version),
diff --git a/index/server/pkg/server/endpoint_test.go b/index/server/pkg/server/endpoint_test.go
new file mode 100644
index 000000000..c32e5d3ff
--- /dev/null
+++ b/index/server/pkg/server/endpoint_test.go
@@ -0,0 +1,1006 @@
+package server
+
+import (
+ "bytes"
+ "encoding/json"
+ "fmt"
+ "io"
+ "io/fs"
+ "io/ioutil"
+ "log"
+ "net/http"
+ "net/http/httptest"
+ "os"
+ "path/filepath"
+ "reflect"
+ "strings"
+ "testing"
+
+ "github.com/devfile/library/pkg/devfile/parser"
+ "github.com/devfile/registry-support/index/server/pkg/ocitest"
+ "github.com/gin-gonic/gin"
+ "github.com/opencontainers/go-digest"
+ "github.com/opencontainers/image-spec/specs-go"
+ ocispec "github.com/opencontainers/image-spec/specs-go/v1"
+)
+
+const (
+ ociServerIP = "127.0.0.1:5000" // Mock OCI server listen address and port number, format: '
:'
+)
+
+var (
+ // mock manifest repository for OCI server
+ manifests = map[string]map[string]ocispec.Manifest{
+ "java-maven": {
+ "1.1.0": {
+ Versioned: specs.Versioned{SchemaVersion: 2},
+ Config: ocispec.Descriptor{
+ MediaType: devfileConfigMediaType,
+ },
+ Layers: []ocispec.Descriptor{
+ {
+ MediaType: devfileMediaType,
+ Digest: "sha256:b81a4a857ebbd6b7093c38703e3b7c6d7a2652abfd55898f82fdea45634fd549",
+ Size: 1251,
+ Annotations: map[string]string{
+ "org.opencontainers.image.title": devfileName,
+ },
+ },
+ },
+ },
+ },
+ "go": {
+ "1.1.0": {
+ Versioned: specs.Versioned{SchemaVersion: 2},
+ Config: ocispec.Descriptor{
+ MediaType: devfileConfigMediaType,
+ },
+ Layers: []ocispec.Descriptor{
+ {
+ MediaType: devfileMediaType,
+ Digest: "sha256:4cad7c1629ba848245205a08107b296adba307f77ca3635b16920473589cb12e",
+ Size: 1086,
+ Annotations: map[string]string{
+ "org.opencontainers.image.title": devfileName,
+ },
+ },
+ },
+ },
+ "1.2.0": {
+ Versioned: specs.Versioned{SchemaVersion: 2},
+ Config: ocispec.Descriptor{
+ MediaType: devfileConfigMediaType,
+ },
+ Layers: []ocispec.Descriptor{
+ {
+ MediaType: devfileMediaType,
+ Digest: "sha256:bb4c6b96292bbcd48f445436f7945399a4d314b111ee976d6235199e854bfb68",
+ Size: 1091,
+ Annotations: map[string]string{
+ "org.opencontainers.image.title": devfileName,
+ },
+ },
+ },
+ },
+ },
+ "java-quarkus": {
+ "1.1.0": {
+ Versioned: specs.Versioned{SchemaVersion: 2},
+ Config: ocispec.Descriptor{
+ MediaType: devfileConfigMediaType,
+ },
+ Layers: []ocispec.Descriptor{
+ {
+ MediaType: devfileMediaType,
+ Digest: "sha256:6143ffeab064d0b9a6991a6e1025a1b63d01be87e197fabb8a34d5a9fc3fcba0",
+ Size: 1935,
+ Annotations: map[string]string{
+ "org.opencontainers.image.title": devfileName,
+ },
+ },
+ },
+ },
+ },
+ "java-wildfly": {
+ "1.0.0": {
+ Versioned: specs.Versioned{SchemaVersion: 2},
+ Config: ocispec.Descriptor{
+ MediaType: devfileConfigMediaType,
+ },
+ Layers: []ocispec.Descriptor{
+ {
+ MediaType: devfileMediaType,
+ Digest: "sha256:a6363457f7603259b7c55c5d5752adcf1cfb146227e90890a3ca8aa6b71879dd",
+ Size: 7151,
+ Annotations: map[string]string{
+ "org.opencontainers.image.title": devfileName,
+ },
+ },
+ },
+ },
+ },
+ }
+)
+
+// serveManifest custom handler for fetching a manifest from the
+// mock OCI server
+func serveManifest(c *gin.Context) {
+ name, ref := c.Param("name"), c.Param("ref")
+ var (
+ stackManifest ocispec.Manifest
+ found bool
+ bytes []byte
+ err error
+ )
+
+ if strings.HasPrefix(ref, "sha256:") {
+ stackManifests, found := manifests[name]
+ if !found {
+ notFoundManifest(c, ref)
+ return
+ }
+
+ found = false
+ for _, manifest := range stackManifests {
+ dgst, err := digestEntity(manifest)
+ if err != nil {
+ log.Fatal(err)
+ } else if reflect.DeepEqual(ref, dgst) {
+ stackManifest = manifest
+ found = true
+ break
+ }
+ }
+
+ if !found {
+ notFoundManifest(c, ref)
+ return
+ }
+ } else {
+ stackManifest, found = manifests[name][ref]
+
+ if !found {
+ notFoundManifest(c, ref)
+ return
+ }
+ }
+
+ if c.Request.Method == http.MethodGet {
+ bytes, err = json.Marshal(stackManifest)
+ if err != nil {
+ log.Fatal(err)
+ }
+ }
+
+ c.Data(http.StatusOK, ocispec.MediaTypeImageManifest, bytes)
+}
+
+// notFoundManifest custom handler for manifest not found status of the mock OCI server
+func notFoundManifest(c *gin.Context, tag string) {
+ var data gin.H = nil
+
+ if c.Request.Method == http.MethodGet {
+ data = ocitest.WriteErrors([]ocitest.ResponseError{
+ {
+ Code: "MANIFEST_UNKNOWN",
+ Message: "manifest unknown",
+ Detail: map[string]interface{}{
+ "Tag": tag,
+ },
+ },
+ })
+ }
+
+ c.JSON(http.StatusNotFound, data)
+}
+
+// digestEntity generates sha256 digest of any entity type
+func digestEntity(e interface{}) (string, error) {
+ bytes, err := json.Marshal(e)
+ if err != nil {
+ return "", err
+ }
+
+ return digest.FromBytes(bytes).String(), nil
+}
+
+// digestFile generates sha256 digest from file contents
+func digestFile(filepath string) (string, error) {
+ file, err := os.Open(filepath)
+ if err != nil {
+ return "", err
+ }
+ defer file.Close()
+
+ dgst, err := digest.FromReader(file)
+ if err != nil {
+ return "", err
+ }
+
+ return dgst.String(), nil
+}
+
+// serveBlob custom handler for fetching a blob from the
+// mock OCI server
+func serveBlob(c *gin.Context) {
+ name, dgst := c.Param("name"), c.Param("digest")
+ stackRoot := filepath.Join(stacksPath, name)
+ var (
+ blobPath string
+ found bool
+ err error
+ )
+
+ found = false
+ err = filepath.WalkDir(stackRoot, func(path string, d fs.DirEntry, err error) error {
+ var fdgst string
+
+ if err != nil {
+ return err
+ }
+
+ if found || d.IsDir() {
+ return nil
+ }
+
+ fdgst, err = digestFile(path)
+ if err != nil {
+ return err
+ } else if reflect.DeepEqual(dgst, fdgst) {
+ blobPath = path
+ found = true
+ }
+
+ return nil
+ })
+ if err != nil {
+ log.Fatal(err)
+ } else if !found {
+ notFoundBlob(c)
+ return
+ }
+
+ file, err := os.Open(blobPath)
+ if err != nil {
+ log.Fatal(err)
+ }
+ defer file.Close()
+
+ bytes, err := io.ReadAll(file)
+ if err != nil {
+ log.Fatal(err)
+ }
+
+ c.Data(http.StatusOK, http.DetectContentType(bytes), bytes)
+}
+
+// notFoundBlob custom handler for blob not found status of the mock OCI server
+func notFoundBlob(c *gin.Context) {
+ c.Data(http.StatusNotFound, "plain/text", []byte{})
+}
+
+// setupMockOCIServer sets up mock OCI server for endpoint testing environment
+func setupMockOCIServer() (func(), error) {
+ mockOCIServer := ocitest.NewMockOCIServer()
+
+ // Pull Routes
+ mockOCIServer.ServeManifest = serveManifest
+ mockOCIServer.ServeBlob = serveBlob
+
+ if err := mockOCIServer.Start(ociServerIP); err != nil {
+ return nil, err
+ }
+
+ return mockOCIServer.Close, nil
+}
+
+// setupVars sets up registry index server global variables for endpoint testing environment
+func setupVars() {
+ var registryPath string
+
+ if _, found := os.LookupEnv("DEVFILE_REGISTRY"); found {
+ registryPath = os.Getenv("DEVFILE_REGISTRY")
+ } else {
+ registryPath = "../../tests/registry"
+ }
+
+ if stacksPath == "" {
+ stacksPath = filepath.Join(registryPath, "stacks")
+ }
+ if samplesPath == "" {
+ samplesPath = filepath.Join(registryPath, "samples")
+ }
+ if indexPath == "" {
+ indexPath = filepath.Join(registryPath, "index_main.json")
+ }
+ if sampleIndexPath == "" {
+ sampleIndexPath = filepath.Join(registryPath, "index_extra.json")
+ }
+ if stackIndexPath == "" {
+ stackIndexPath = filepath.Join(registryPath, "index_registry.json")
+ }
+}
+
+// TestMockOCIServer tests if MockOCIServer is listening for
+// requests using the custom '/v2/ping' route
+func TestMockOCIServer(t *testing.T) {
+ mockOCIServer := ocitest.NewMockOCIServer()
+ if err := mockOCIServer.Start(ociServerIP); err != nil {
+ t.Errorf("Failed to setup mock OCI server: %v", err)
+ return
+ }
+ defer mockOCIServer.Close()
+ setupVars()
+
+ resp, err := http.Get(fmt.Sprintf("http://%s", filepath.Join(ociServerIP, "/v2/ping")))
+ if err != nil {
+ t.Errorf("Error in request: %v", err)
+ return
+ }
+
+ if !reflect.DeepEqual(resp.StatusCode, http.StatusOK) {
+ t.Errorf("Did not get expected status code, Got: %v, Expected: %v", resp.StatusCode, http.StatusOK)
+ }
+}
+
+// TestServeHealthCheck tests health check endpoint '/health'
+func TestServeHealthCheck(t *testing.T) {
+ var got gin.H
+
+ gin.SetMode(gin.TestMode)
+
+ setupVars()
+
+ w := httptest.NewRecorder()
+ c, _ := gin.CreateTestContext(w)
+
+ serveHealthCheck(c)
+
+ wantStatusCode := http.StatusOK
+ if gotStatusCode := w.Code; !reflect.DeepEqual(gotStatusCode, wantStatusCode) {
+ t.Errorf("Did not get expected status code, Got: %v, Expected: %v", gotStatusCode, wantStatusCode)
+ return
+ }
+
+ wantContentType := "application/json"
+ header := w.Header()
+ if gotContentType := strings.Split(header.Get("Content-Type"), ";")[0]; !reflect.DeepEqual(gotContentType, wantContentType) {
+ t.Errorf("Did not get expected content type, Got: %v, Expected: %v", gotContentType, wantContentType)
+ return
+ }
+
+ bytes, err := ioutil.ReadAll(w.Body)
+ if err != nil {
+ t.Fatalf("Did not expect error: %v", err)
+ return
+ }
+
+ if err = json.Unmarshal(bytes, &got); err != nil {
+ t.Fatalf("Did not expect error: %v", err)
+ return
+ }
+
+ wantMessage := "the server is up and running"
+ gotMessage, found := got["message"]
+ if !found {
+ t.Error("Did not get any body or message.")
+ return
+ } else if !reflect.DeepEqual(gotMessage, wantMessage) {
+ t.Errorf("Did not get expected body or message, Got: %v, Expected: %v", gotMessage, wantMessage)
+ return
+ }
+}
+
+// TestServeDevfileIndexV1 tests '/index' endpoint
+func TestServeDevfileIndexV1(t *testing.T) {
+ const wantStatusCode = http.StatusOK
+
+ setupVars()
+
+ gin.SetMode(gin.TestMode)
+
+ w := httptest.NewRecorder()
+ c, _ := gin.CreateTestContext(w)
+
+ serveDevfileIndexV1(c)
+
+ if gotStatusCode := w.Code; !reflect.DeepEqual(gotStatusCode, wantStatusCode) {
+ t.Errorf("Did not get expected status code, Got: %v, Expected: %v", gotStatusCode, wantStatusCode)
+ return
+ }
+}
+
+// TestServeDevfileIndexV1WithType tests '/index/:type' endpoint
+func TestServeDevfileIndexV1WithType(t *testing.T) {
+ setupVars()
+ tests := []struct {
+ name string
+ params gin.Params
+ wantCode int
+ }{
+ {
+ name: "GET /index/stack - Successful Response Test",
+ params: gin.Params{
+ gin.Param{Key: "type", Value: "stack"},
+ },
+ wantCode: http.StatusOK,
+ },
+ {
+ name: "GET /index/sample - Successful Response Test",
+ params: gin.Params{
+ gin.Param{Key: "type", Value: "sample"},
+ },
+ wantCode: http.StatusOK,
+ },
+ {
+ name: "GET /index/all - Successful Response Test",
+ params: gin.Params{
+ gin.Param{Key: "type", Value: "all"},
+ },
+ wantCode: http.StatusOK,
+ },
+ {
+ name: "GET /index/notatype - Type Not Found Response Test",
+ params: gin.Params{
+ gin.Param{Key: "type", Value: "notatype"},
+ },
+ wantCode: http.StatusNotFound,
+ },
+ }
+
+ for _, test := range tests {
+ t.Run(test.name, func(tt *testing.T) {
+ gin.SetMode(gin.TestMode)
+
+ w := httptest.NewRecorder()
+ c, _ := gin.CreateTestContext(w)
+
+ c.Params = append(c.Params, test.params...)
+
+ serveDevfileIndexV1WithType(c)
+
+ if gotStatusCode := w.Code; !reflect.DeepEqual(gotStatusCode, test.wantCode) {
+ t.Errorf("Did not get expected status code, Got: %v, Expected: %v", gotStatusCode, test.wantCode)
+ return
+ }
+ })
+ }
+}
+
+// TestServeDevfileIndexV2 tests '/v2index' endpoint
+func TestServeDevfileIndexV2(t *testing.T) {
+ const wantStatusCode = http.StatusOK
+
+ setupVars()
+
+ gin.SetMode(gin.TestMode)
+
+ w := httptest.NewRecorder()
+ c, _ := gin.CreateTestContext(w)
+
+ serveDevfileIndexV2(c)
+
+ if gotStatusCode := w.Code; !reflect.DeepEqual(gotStatusCode, wantStatusCode) {
+ t.Errorf("Did not get expected status code, Got: %v, Expected: %v", gotStatusCode, wantStatusCode)
+ return
+ }
+}
+
+// TestServeDevfileIndexV2 tests '/v2index/:type' endpoint
+func TestServeDevfileIndexV2WithType(t *testing.T) {
+ setupVars()
+ tests := []struct {
+ name string
+ params gin.Params
+ wantCode int
+ }{
+ {
+ name: "GET /v2index/stack - Successful Response Test",
+ params: gin.Params{
+ gin.Param{Key: "type", Value: "stack"},
+ },
+ wantCode: http.StatusOK,
+ },
+ {
+ name: "GET /v2index/sample - Successful Response Test",
+ params: gin.Params{
+ gin.Param{Key: "type", Value: "sample"},
+ },
+ wantCode: http.StatusOK,
+ },
+ {
+ name: "GET /v2index/all - Successful Response Test",
+ params: gin.Params{
+ gin.Param{Key: "type", Value: "all"},
+ },
+ wantCode: http.StatusOK,
+ },
+ {
+ name: "GET /v2index/notatype - Type Not Found Response Test",
+ params: gin.Params{
+ gin.Param{Key: "type", Value: "notatype"},
+ },
+ wantCode: http.StatusNotFound,
+ },
+ }
+
+ for _, test := range tests {
+ t.Run(test.name, func(tt *testing.T) {
+ gin.SetMode(gin.TestMode)
+
+ w := httptest.NewRecorder()
+ c, _ := gin.CreateTestContext(w)
+
+ c.Params = append(c.Params, test.params...)
+
+ serveDevfileIndexV2WithType(c)
+
+ if gotStatusCode := w.Code; !reflect.DeepEqual(gotStatusCode, test.wantCode) {
+ t.Errorf("Did not get expected status code, Got: %v, Expected: %v", gotStatusCode, test.wantCode)
+ return
+ }
+ })
+ }
+}
+
+// TestServeDevfile tests '/devfiles/:name' endpoint
+func TestServeDevfile(t *testing.T) {
+ tests := []struct {
+ name string
+ params gin.Params
+ wantCode int
+ wantSchemaVersion string
+ wantError bool
+ }{
+ {
+ name: "GET /devfiles/java-maven - Fetch Java Maven Devfile",
+ params: gin.Params{
+ gin.Param{Key: "name", Value: "java-maven"},
+ },
+ wantCode: http.StatusOK,
+ wantSchemaVersion: "2.2.0",
+ },
+ {
+ name: "GET /devfiles/go - Fetch Go Devfile",
+ params: gin.Params{
+ gin.Param{Key: "name", Value: "go"},
+ },
+ wantCode: http.StatusOK,
+ wantSchemaVersion: "2.0.0",
+ },
+ {
+ name: "GET /devfiles/not-exist - Fetch Non-Existent Devfile",
+ params: gin.Params{
+ gin.Param{Key: "name", Value: "not-exist"},
+ },
+ wantCode: http.StatusNotFound,
+ wantError: true,
+ },
+ }
+
+ closeServer, err := setupMockOCIServer()
+ if err != nil {
+ t.Errorf("Did not setup mock OCI server properly: %v", err)
+ return
+ }
+ defer closeServer()
+ setupVars()
+
+ for _, test := range tests {
+ t.Run(test.name, func(tt *testing.T) {
+ gin.SetMode(gin.TestMode)
+
+ w := httptest.NewRecorder()
+ c, _ := gin.CreateTestContext(w)
+
+ c.Params = append(c.Params, test.params...)
+
+ serveDevfile(c)
+
+ if gotStatusCode := w.Code; !reflect.DeepEqual(gotStatusCode, test.wantCode) {
+ t.Errorf("Did not get expected status code, Got: %v, Expected: %v", gotStatusCode, test.wantCode)
+ } else if !test.wantError {
+ bytes := w.Body.Bytes()
+ content, err := parser.ParseFromData(bytes)
+ if err != nil {
+ t.Fatalf("Did not expect error: %v", err)
+ }
+
+ if gotSchemaVersion := content.Data.GetSchemaVersion(); !reflect.DeepEqual(gotSchemaVersion, test.wantSchemaVersion) {
+ t.Errorf("Did not get expected status code, Got: %v, Expected: %v", gotSchemaVersion, test.wantSchemaVersion)
+ }
+ }
+ })
+ }
+}
+
+// TestServeDevfileWithVersion tests '/devfiles/:name/:version' endpoint
+func TestServeDevfileWithVersion(t *testing.T) {
+ tests := []struct {
+ name string
+ params gin.Params
+ wantCode int
+ wantSchemaVersion string
+ wantError bool
+ }{
+ {
+ name: "GET /devfiles/go/default - Fetch Go Devfile With Default Version",
+ params: gin.Params{
+ gin.Param{Key: "name", Value: "go"},
+ gin.Param{Key: "version", Value: "default"},
+ },
+ wantCode: http.StatusOK,
+ wantSchemaVersion: "2.0.0",
+ },
+ {
+ name: "GET /devfiles/go/latest - Fetch Go Devfile With Latest Version",
+ params: gin.Params{
+ gin.Param{Key: "name", Value: "go"},
+ gin.Param{Key: "version", Value: "latest"},
+ },
+ wantCode: http.StatusOK,
+ wantSchemaVersion: "2.1.0",
+ },
+ {
+ name: "GET /devfiles/go/1.2.0 - Fetch Go Devfile With Specific Version",
+ params: gin.Params{
+ gin.Param{Key: "name", Value: "go"},
+ gin.Param{Key: "version", Value: "1.2.0"},
+ },
+ wantCode: http.StatusOK,
+ wantSchemaVersion: "2.1.0",
+ },
+ {
+ name: "GET /devfiles/not-exist/latest - Fetch Non-Existent Devfile With Latest Version",
+ params: gin.Params{
+ gin.Param{Key: "name", Value: "not-exist"},
+ gin.Param{Key: "version", Value: "latest"},
+ },
+ wantCode: http.StatusNotFound,
+ wantError: true,
+ },
+ {
+ name: "GET /devfiles/java-maven/not-exist - Fetch Java Maven Devfile With Non-Existent Version",
+ params: gin.Params{
+ gin.Param{Key: "name", Value: "java-maven"},
+ gin.Param{Key: "version", Value: "non-exist"},
+ },
+ wantCode: http.StatusNotFound,
+ wantError: true,
+ },
+ }
+
+ closeServer, err := setupMockOCIServer()
+ if err != nil {
+ t.Errorf("Did not setup mock OCI server properly: %v", err)
+ return
+ }
+ defer closeServer()
+ setupVars()
+
+ for _, test := range tests {
+ t.Run(test.name, func(tt *testing.T) {
+ gin.SetMode(gin.TestMode)
+
+ w := httptest.NewRecorder()
+ c, _ := gin.CreateTestContext(w)
+
+ c.Params = append(c.Params, test.params...)
+
+ serveDevfileWithVersion(c)
+
+ if gotStatusCode := w.Code; !reflect.DeepEqual(gotStatusCode, test.wantCode) {
+ t.Errorf("Did not get expected status code, Got: %v, Expected: %v", gotStatusCode, test.wantCode)
+ } else if !test.wantError {
+ bytes := w.Body.Bytes()
+ content, err := parser.ParseFromData(bytes)
+ if err != nil {
+ t.Fatalf("Did not expect error: %v", err)
+ }
+
+ if gotSchemaVersion := content.Data.GetSchemaVersion(); !reflect.DeepEqual(gotSchemaVersion, test.wantSchemaVersion) {
+ t.Errorf("Did not get expected status code, Got: %v, Expected: %v", gotSchemaVersion, test.wantSchemaVersion)
+ }
+ }
+ })
+ }
+}
+
+// TestServeDevfileStarterProject tests '/devfiles/:name/starter-projects/:starterProjectName' endpoint
+func TestServeDevfileStarterProject(t *testing.T) {
+ const wantContentType = starterProjectMediaType
+ tests := []struct {
+ name string
+ params gin.Params
+ wantCode int
+ wantError bool
+ }{
+ {
+ name: "GET /devfiles/java-maven/starter-projects/springbootproject - Fetch Java Maven 'springbootproject' Starter Project",
+ params: gin.Params{
+ gin.Param{Key: "name", Value: "java-maven"},
+ gin.Param{Key: "starterProjectName", Value: "springbootproject"},
+ },
+ wantCode: http.StatusAccepted,
+ },
+ {
+ name: "GET /devfiles/go/starter-projects/go-starter - Fetch Go 'go-starter' Starter Project",
+ params: gin.Params{
+ gin.Param{Key: "name", Value: "go"},
+ gin.Param{Key: "starterProjectName", Value: "go-starter"},
+ },
+ wantCode: http.StatusAccepted,
+ },
+ {
+ name: "GET /devfiles/java-quarkus/starter-projects/community - Fetch Java Quarkus 'community' Starter Project",
+ params: gin.Params{
+ gin.Param{Key: "name", Value: "java-quarkus"},
+ gin.Param{Key: "starterProjectName", Value: "community"},
+ },
+ wantCode: http.StatusAccepted,
+ },
+ {
+ name: "GET /devfiles/java-wildfly/starter-projects/microprofile-config - Fetch Java Wildfly 'microprofile-config' Starter Project",
+ params: gin.Params{
+ gin.Param{Key: "name", Value: "java-wildfly"},
+ gin.Param{Key: "starterProjectName", Value: "microprofile-config"},
+ },
+ wantCode: http.StatusAccepted,
+ },
+ {
+ name: "GET /devfiles/java-wildfly/starter-projects/microprofile-jwt - Fetch Java Wildfly 'microprofile-jwt' Starter Project",
+ params: gin.Params{
+ gin.Param{Key: "name", Value: "java-wildfly"},
+ gin.Param{Key: "starterProjectName", Value: "microprofile-jwt"},
+ },
+ wantCode: http.StatusAccepted,
+ },
+ {
+ name: "GET /devfiles/not-exist/starter-projects/some - Fetch 'some' starter project from Non-Existent stack",
+ params: gin.Params{
+ gin.Param{Key: "name", Value: "not-exist"},
+ gin.Param{Key: "starterProjectName", Value: "some"},
+ },
+ wantCode: http.StatusNotFound,
+ wantError: true,
+ },
+ {
+ name: "GET /devfiles/java-maven/starter-projects/not-exist - Fetch Non-Existent starter project from Java Maven stack",
+ params: gin.Params{
+ gin.Param{Key: "name", Value: "java-maven"},
+ gin.Param{Key: "starterProjectName", Value: "not-exist"},
+ },
+ wantCode: http.StatusNotFound,
+ wantError: true,
+ },
+ }
+
+ closeServer, err := setupMockOCIServer()
+ if err != nil {
+ t.Errorf("Did not setup mock OCI server properly: %v", err)
+ return
+ }
+ defer closeServer()
+ setupVars()
+
+ for _, test := range tests {
+ t.Run(test.name, func(tt *testing.T) {
+ gin.SetMode(gin.TestMode)
+
+ w := httptest.NewRecorder()
+ c, _ := gin.CreateTestContext(w)
+
+ c.Params = append(c.Params, test.params...)
+
+ serveDevfileStarterProject(c)
+
+ if gotStatusCode := w.Code; !reflect.DeepEqual(gotStatusCode, test.wantCode) {
+ t.Errorf("Did not get expected status code, Got: %v, Expected: %v", gotStatusCode, test.wantCode)
+ } else if !test.wantError {
+ gotContentType := http.DetectContentType(w.Body.Bytes())
+ if !reflect.DeepEqual(gotContentType, wantContentType) {
+ t.Errorf("Did not get expected content-type, Got: %v, Expected: %v", gotContentType, wantContentType)
+ }
+ }
+ })
+ }
+}
+
+// TestServeDevfileStarterProjectWithVersion tests '/devfiles/:name/:version/starter-projects/:starterProjectName' endpoint
+func TestServeDevfileStarterProjectWithVersion(t *testing.T) {
+ const wantContentType = starterProjectMediaType
+ tests := []struct {
+ name string
+ params gin.Params
+ wantCode int
+ wantError bool
+ }{
+ {
+ name: "GET /devfiles/go/default/starter-projects/go-starter - Fetch Go 'go-starter' Starter Project With Default Version",
+ params: gin.Params{
+ gin.Param{Key: "name", Value: "go"},
+ gin.Param{Key: "version", Value: "default"},
+ gin.Param{Key: "starterProjectName", Value: "go-starter"},
+ },
+ wantCode: http.StatusAccepted,
+ },
+ {
+ name: "GET /devfiles/go/latest/starter-projects/go-starter - Fetch Go 'go-starter' Starter Project With Latest Version",
+ params: gin.Params{
+ gin.Param{Key: "name", Value: "go"},
+ gin.Param{Key: "version", Value: "latest"},
+ gin.Param{Key: "starterProjectName", Value: "go-starter"},
+ },
+ wantCode: http.StatusAccepted,
+ },
+ {
+ name: "GET /devfiles/go/1.2.0/starter-projects/go-starter - Fetch Go 'go-starter' Starter Project With Specific Version",
+ params: gin.Params{
+ gin.Param{Key: "name", Value: "go"},
+ gin.Param{Key: "version", Value: "1.2.0"},
+ gin.Param{Key: "starterProjectName", Value: "go-starter"},
+ },
+ wantCode: http.StatusAccepted,
+ },
+ {
+ name: "GET /devfiles/not-exist/latest/starter-projects/some - " +
+ "Fetch 'some' starter project from Non-Existent stack With Latest Version",
+ params: gin.Params{
+ gin.Param{Key: "name", Value: "not-exist"},
+ gin.Param{Key: "version", Value: "latest"},
+ gin.Param{Key: "starterProjectName", Value: "some"},
+ },
+ wantCode: http.StatusNotFound,
+ wantError: true,
+ },
+ {
+ name: "GET /devfiles/java-maven/latest/starter-projects/not-exist - " +
+ "Fetch Non-Existent starter project from Java Maven stack With Latest Version",
+ params: gin.Params{
+ gin.Param{Key: "name", Value: "java-maven"},
+ gin.Param{Key: "version", Value: "latest"},
+ gin.Param{Key: "starterProjectName", Value: "not-exist"},
+ },
+ wantCode: http.StatusNotFound,
+ wantError: true,
+ },
+ {
+ name: "GET /devfiles/java-maven/not-exist/starter-projects/springbootproject - " +
+ "Fetch Java Maven 'springbootproject' Starter Project With Non-Existent Version",
+ params: gin.Params{
+ gin.Param{Key: "name", Value: "java-maven"},
+ gin.Param{Key: "version", Value: "non-exist"},
+ gin.Param{Key: "starterProjectName", Value: "springbootproject"},
+ },
+ wantCode: http.StatusNotFound,
+ wantError: true,
+ },
+ }
+
+ closeServer, err := setupMockOCIServer()
+ if err != nil {
+ t.Errorf("Did not setup mock OCI server properly: %v", err)
+ return
+ }
+ defer closeServer()
+ setupVars()
+
+ for _, test := range tests {
+ t.Run(test.name, func(tt *testing.T) {
+ gin.SetMode(gin.TestMode)
+
+ w := httptest.NewRecorder()
+ c, _ := gin.CreateTestContext(w)
+
+ c.Params = append(c.Params, test.params...)
+
+ serveDevfileStarterProjectWithVersion(c)
+
+ if gotStatusCode := w.Code; !reflect.DeepEqual(gotStatusCode, test.wantCode) {
+ t.Errorf("Did not get expected status code, Got: %v, Expected: %v", gotStatusCode, test.wantCode)
+ } else if !test.wantError {
+ gotContentType := http.DetectContentType(w.Body.Bytes())
+ if !reflect.DeepEqual(gotContentType, wantContentType) {
+ t.Errorf("Did not get expected content-type, Got: %v, Expected: %v", gotContentType, wantContentType)
+ }
+ }
+ })
+ }
+}
+
+// TestOCIServerProxy tests '/v2/*proxyPath' endpoint
+func TestOCIServerProxy(t *testing.T) {
+ tests := []struct {
+ name string
+ method string
+ url string
+ wantCode int
+ wantError bool
+ }{
+ {
+ name: "HEAD /v2/devfile-catalog/go/manifests/1.2.0",
+ method: http.MethodHead,
+ url: "/devfile-catalog/go/manifests/1.2.0",
+ wantCode: 200,
+ },
+ {
+ name: "HEAD /v2/devfile-catalog/go/manifests/notfound",
+ method: http.MethodHead,
+ url: "/devfile-catalog/go/manifests/notfound",
+ wantCode: 404,
+ wantError: true,
+ },
+ {
+ name: "GET /v2/devfile-catalog/go/manifests/1.2.0",
+ method: http.MethodGet,
+ url: "/devfile-catalog/go/manifests/1.2.0",
+ wantCode: 200,
+ },
+ {
+ name: "GET /v2/devfile-catalog/go/manifests/notfound",
+ method: http.MethodGet,
+ url: "/devfile-catalog/go/manifests/notfound",
+ wantCode: 404,
+ wantError: true,
+ },
+ {
+ name: "HEAD /v2/devfile-catalog/go/blobs/sha256:bb4c6b96292bbcd48f445436f7945399a4d314b111ee976d6235199e854bfb68",
+ method: http.MethodHead,
+ url: "/devfile-catalog/go/blobs/sha256:bb4c6b96292bbcd48f445436f7945399a4d314b111ee976d6235199e854bfb68",
+ wantCode: 200,
+ },
+ {
+ name: "HEAD /v2/devfile-catalog/go/blobs/notfound",
+ method: http.MethodHead,
+ url: "/devfile-catalog/go/blobs/notfound",
+ wantCode: 404,
+ wantError: true,
+ },
+ {
+ name: "GET /v2/devfile-catalog/go/blobs/sha256:bb4c6b96292bbcd48f445436f7945399a4d314b111ee976d6235199e854bfb68",
+ method: http.MethodGet,
+ url: "/devfile-catalog/go/blobs/sha256:bb4c6b96292bbcd48f445436f7945399a4d314b111ee976d6235199e854bfb68",
+ wantCode: 200,
+ },
+ {
+ name: "GET /v2/devfile-catalog/go/blobs/notfound",
+ method: http.MethodGet,
+ url: "/devfile-catalog/go/blobs/notfound",
+ wantCode: 404,
+ wantError: true,
+ },
+ }
+
+ closeServer, err := setupMockOCIServer()
+ if err != nil {
+ t.Errorf("Did not setup mock OCI server properly: %v", err)
+ return
+ }
+ defer closeServer()
+ setupVars()
+
+ for _, test := range tests {
+ t.Run(test.name, func(tt *testing.T) {
+ gin.SetMode(gin.TestMode)
+
+ w := ocitest.NewProxyRecorder()
+ c, _ := gin.CreateTestContext(w)
+ url := fmt.Sprintf("%s://%s", scheme, filepath.Join(ociServerIP, "v2", test.url))
+
+ c.Request, err = http.NewRequest(test.method, url, bytes.NewBuffer([]byte{}))
+ if err != nil {
+ t.Fatalf("Did not expect error: %v", err)
+ }
+ c.Params = append(c.Params, gin.Param{Key: "proxyPath", Value: test.url})
+
+ ociServerProxy(c)
+
+ // Force writes response headers to combat a response recording issue
+ c.Writer.WriteHeaderNow()
+
+ if gotStatusCode := w.Code; !reflect.DeepEqual(gotStatusCode, test.wantCode) {
+ t.Errorf("Did not get expected status code, Got: %v, Expected: %v", gotStatusCode, test.wantCode)
+ }
+ })
+ }
+}
diff --git a/index/server/tests/registry/extraDevfileEntries.yaml b/index/server/tests/registry/extraDevfileEntries.yaml
new file mode 100644
index 000000000..a11a5cb84
--- /dev/null
+++ b/index/server/tests/registry/extraDevfileEntries.yaml
@@ -0,0 +1,39 @@
+schemaVersion: 1.0.0
+samples:
+ - name: nodejs-basic
+ displayName: Basic NodeJS
+ description: A simple Hello World application
+ icon: nodejsIcon.svg
+ tags: ["NodeJS", "Express"]
+ projectType: nodejs
+ language: nodejs
+ versions:
+ - version: 1.0.0
+ schemaVersion: 2.0.0
+ description: nodejs with devfile v2.0.0
+ git:
+ remotes:
+ origin: https://github.com/redhat-developer/devfile-sample
+ - version: 1.0.1
+ schemaVersion: 2.2.0
+ default: true
+ description: nodejs with devfile v2.2.0
+ git:
+ remotes:
+ origin: https://github.com/nodeshift-starters/devfile-sample
+ - name: code-with-quarkus
+ displayName: Basic Quarkus
+ description: A simple Hello World Java application using Quarkus
+ icon: https://raw.githubusercontent.com/elsony/devfile-sample-code-with-quarkus/main/.devfile/icon/quarkus.png
+ tags: ["Java", "Quarkus"]
+ projectType: quarkus
+ language: java
+ provider: Red Hat
+ versions:
+ - version: 1.1.0
+ schemaVersion: 2.0.0
+ default: true
+ description: java quarkus with devfile v2.0.0
+ git:
+ remotes:
+ origin: https://github.com/elsony/devfile-sample-code-with-quarkus.git
\ No newline at end of file
diff --git a/index/server/tests/registry/index_extra.json b/index/server/tests/registry/index_extra.json
new file mode 100644
index 000000000..a605f4c9b
--- /dev/null
+++ b/index/server/tests/registry/index_extra.json
@@ -0,0 +1,65 @@
+[
+ {
+ "name": "nodejs-basic",
+ "displayName": "Basic NodeJS",
+ "description": "A simple Hello World application",
+ "type": "sample",
+ "tags": [
+ "NodeJS",
+ "Express"
+ ],
+ "icon": "nodejsIcon.svg",
+ "projectType": "nodejs",
+ "language": "nodejs",
+ "versions": [
+ {
+ "version": "1.0.0",
+ "schemaVersion": "2.0.0",
+ "git": {
+ "remotes": {
+ "origin": "https://github.com/redhat-developer/devfile-sample"
+ }
+ },
+ "description": "nodejs with devfile v2.0.0"
+ },
+ {
+ "version": "1.0.1",
+ "schemaVersion": "2.2.0",
+ "default": true,
+ "git": {
+ "remotes": {
+ "origin": "https://github.com/nodeshift-starters/devfile-sample"
+ }
+ },
+ "description": "nodejs with devfile v2.2.0"
+ }
+ ]
+ },
+ {
+ "name": "code-with-quarkus",
+ "displayName": "Basic Quarkus",
+ "description": "A simple Hello World Java application using Quarkus",
+ "type": "sample",
+ "tags": [
+ "Java",
+ "Quarkus"
+ ],
+ "icon": "https://raw.githubusercontent.com/elsony/devfile-sample-code-with-quarkus/main/.devfile/icon/quarkus.png",
+ "projectType": "quarkus",
+ "language": "java",
+ "provider": "Red Hat",
+ "versions": [
+ {
+ "version": "1.1.0",
+ "schemaVersion": "2.0.0",
+ "default": true,
+ "git": {
+ "remotes": {
+ "origin": "https://github.com/elsony/devfile-sample-code-with-quarkus.git"
+ }
+ },
+ "description": "java quarkus with devfile v2.0.0"
+ }
+ ]
+ }
+]
\ No newline at end of file
diff --git a/index/server/tests/registry/index_main.json b/index/server/tests/registry/index_main.json
new file mode 100644
index 000000000..64363af21
--- /dev/null
+++ b/index/server/tests/registry/index_main.json
@@ -0,0 +1,493 @@
+[
+ {
+ "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"
+ ],
+ "projectType": "maven",
+ "language": "java",
+ "provider": "Red Hat",
+ "versions": [
+ {
+ "version": "1.1.0",
+ "schemaVersion": "2.2.0",
+ "default": true,
+ "description": "Upstream Maven and OpenJDK 11",
+ "tags": [
+ "Java",
+ "Maven"
+ ],
+ "links": {
+ "self": "devfile-catalog/java-maven:1.1.0"
+ },
+ "resources": [
+ "devfile.yaml"
+ ],
+ "starterProjects": [
+ "springbootproject"
+ ]
+ }
+ ]
+ },
+ {
+ "name": "java-openliberty",
+ "displayName": "Open Liberty",
+ "description": "Java application stack using Open Liberty runtime",
+ "type": "stack",
+ "projectType": "docker",
+ "language": "java",
+ "provider": "Red Hat",
+ "versions": [
+ {
+ "version": "0.5.0",
+ "schemaVersion": "2.2.0",
+ "default": true,
+ "description": "Java application stack using Open Liberty runtime",
+ "links": {
+ "self": "devfile-catalog/java-openliberty:0.5.0"
+ },
+ "resources": [
+ "devfile.yaml"
+ ],
+ "starterProjects": [
+ "user-app"
+ ]
+ }
+ ]
+ },
+ {
+ "name": "java-quarkus",
+ "displayName": "Quarkus Java",
+ "description": "Upstream Quarkus with Java+GraalVM",
+ "type": "stack",
+ "tags": [
+ "Java",
+ "Quarkus"
+ ],
+ "projectType": "quarkus",
+ "language": "java",
+ "provider": "Red Hat",
+ "versions": [
+ {
+ "version": "1.1.0",
+ "schemaVersion": "2.2.0",
+ "default": true,
+ "description": "Upstream Quarkus with Java+GraalVM",
+ "tags": [
+ "Java",
+ "Quarkus"
+ ],
+ "links": {
+ "self": "devfile-catalog/java-quarkus:1.1.0"
+ },
+ "resources": [
+ "devfile.yaml"
+ ],
+ "starterProjects": [
+ "community",
+ "redhat-product"
+ ]
+ }
+ ]
+ },
+ {
+ "name": "java-springboot",
+ "displayName": "Spring Boot®",
+ "description": "Spring Boot® using Java",
+ "type": "stack",
+ "tags": [
+ "Java",
+ "Spring"
+ ],
+ "icon": "https://www.eclipse.org/che/images/logo-eclipseche.svg",
+ "projectType": "spring",
+ "language": "java",
+ "versions": [
+ {
+ "version": "1.1.0",
+ "schemaVersion": "2.2.0",
+ "default": true,
+ "description": "Spring Boot® using Java",
+ "tags": [
+ "Java",
+ "Spring"
+ ],
+ "icon": "https://www.eclipse.org/che/images/logo-eclipseche.svg",
+ "links": {
+ "self": "devfile-catalog/java-springboot:1.1.0"
+ },
+ "resources": [
+ "devfile.yaml"
+ ],
+ "starterProjects": [
+ "springbootproject"
+ ]
+ }
+ ]
+ },
+ {
+ "name": "java-vertx",
+ "displayName": "Vert.x Java",
+ "description": "Upstream Vert.x using Java",
+ "type": "stack",
+ "tags": [
+ "Java",
+ "Vert.x"
+ ],
+ "projectType": "vertx",
+ "language": "java",
+ "versions": [
+ {
+ "version": "1.1.0",
+ "schemaVersion": "2.2.0",
+ "default": true,
+ "description": "Upstream Vert.x using Java",
+ "tags": [
+ "Java",
+ "Vert.x"
+ ],
+ "links": {
+ "self": "devfile-catalog/java-vertx:1.1.0"
+ },
+ "resources": [
+ "devfile.yaml"
+ ],
+ "starterProjects": [
+ "vertx-http-example",
+ "vertx-istio-circuit-breaker-booster",
+ "vertx-istio-routing-booster",
+ "vertx-secured-http-example-redhat",
+ "vertx-crud-example-redhat",
+ "vertx-istio-security-booster",
+ "vertx-crud-example",
+ "vertx-circuit-breaker-example",
+ "vertx-configmap-example",
+ "vertx-circuit-breaker-example-redhat",
+ "vertx-cache-example-redhat",
+ "vertx-cache-example",
+ "vertx-secured-http-example",
+ "vertx-health-checks-example-redhat",
+ "vertx-http-example-redhat",
+ "vertx-health-checks-example",
+ "vertx-configmap-example-redhat",
+ "vertx-messaging-work-queue-booster",
+ "vertx-istio-distributed-tracing-booster"
+ ]
+ }
+ ]
+ },
+ {
+ "name": "java-wildfly",
+ "displayName": "WildFly Java",
+ "description": "Upstream WildFly",
+ "type": "stack",
+ "tags": [
+ "Java",
+ "WildFly"
+ ],
+ "projectType": "wildfly",
+ "language": "java",
+ "versions": [
+ {
+ "version": "1.0.0",
+ "schemaVersion": "2.2.0",
+ "default": true,
+ "description": "Upstream WildFly",
+ "tags": [
+ "Java",
+ "WildFly"
+ ],
+ "links": {
+ "self": "devfile-catalog/java-wildfly:1.0.0"
+ },
+ "resources": [
+ "devfile.yaml"
+ ],
+ "starterProjects": [
+ "microprofile-config",
+ "microprofile-fault-tolerance",
+ "microprofile-health",
+ "microprofile-jwt",
+ "microprofile-metrics",
+ "microprofile-openapi",
+ "microprofile-opentracing",
+ "microprofile-rest-client"
+ ]
+ }
+ ]
+ },
+ {
+ "name": "java-wildfly-bootable-jar",
+ "displayName": "WildFly Bootable Jar",
+ "description": "Java stack with WildFly in bootable Jar mode, OpenJDK 11 and Maven 3.5",
+ "type": "stack",
+ "tags": [
+ "RHEL8",
+ "Java",
+ "OpenJDK",
+ "Maven",
+ "WildFly",
+ "Microprofile",
+ "WildFly Bootable"
+ ],
+ "projectType": "WildFly",
+ "language": "java",
+ "versions": [
+ {
+ "version": "1.0.0",
+ "schemaVersion": "2.2.0",
+ "default": true,
+ "description": "Java stack with WildFly in bootable Jar mode, OpenJDK 11 and Maven 3.5",
+ "tags": [
+ "RHEL8",
+ "Java",
+ "OpenJDK",
+ "Maven",
+ "WildFly",
+ "Microprofile",
+ "WildFly Bootable"
+ ],
+ "links": {
+ "self": "devfile-catalog/java-wildfly-bootable-jar:1.0.0"
+ },
+ "resources": [
+ "devfile.yaml"
+ ],
+ "starterProjects": [
+ "microprofile-config",
+ "microprofile-fault-tolerance",
+ "microprofile-health",
+ "microprofile-jwt",
+ "microprofile-metrics",
+ "microprofile-openapi",
+ "microprofile-opentracing",
+ "microprofile-rest-client"
+ ]
+ }
+ ]
+ },
+ {
+ "name": "nodejs",
+ "displayName": "NodeJS Runtime",
+ "description": "Stack with NodeJS 12",
+ "type": "stack",
+ "tags": [
+ "NodeJS",
+ "Express",
+ "ubi8"
+ ],
+ "projectType": "nodejs",
+ "language": "nodejs",
+ "versions": [
+ {
+ "version": "1.0.0",
+ "schemaVersion": "2.2.0",
+ "default": true,
+ "description": "Stack with NodeJS 12",
+ "tags": [
+ "NodeJS",
+ "Express",
+ "ubi8"
+ ],
+ "links": {
+ "self": "devfile-catalog/nodejs:1.0.0"
+ },
+ "resources": [
+ "archive.tar",
+ "devfile.yaml"
+ ],
+ "starterProjects": [
+ "nodejs-starter"
+ ]
+ }
+ ]
+ },
+ {
+ "name": "python",
+ "displayName": "Python",
+ "description": "Python Stack with Python 3.7",
+ "type": "stack",
+ "tags": [
+ "Python",
+ "pip"
+ ],
+ "projectType": "python",
+ "language": "python",
+ "versions": [
+ {
+ "version": "1.0.0",
+ "schemaVersion": "2.2.0",
+ "default": true,
+ "description": "Python Stack with Python 3.7",
+ "tags": [
+ "Python",
+ "pip"
+ ],
+ "links": {
+ "self": "devfile-catalog/python:1.0.0"
+ },
+ "resources": [
+ "devfile.yaml"
+ ],
+ "starterProjects": [
+ "python-example"
+ ]
+ }
+ ]
+ },
+ {
+ "name": "python-django",
+ "displayName": "Django",
+ "description": "Python3.7 with Django",
+ "type": "stack",
+ "tags": [
+ "Python",
+ "pip",
+ "Django"
+ ],
+ "projectType": "django",
+ "language": "python",
+ "versions": [
+ {
+ "version": "1.0.0",
+ "schemaVersion": "2.2.0",
+ "default": true,
+ "description": "Python3.7 with Django",
+ "tags": [
+ "Python",
+ "pip",
+ "Django"
+ ],
+ "links": {
+ "self": "devfile-catalog/python-django:1.0.0"
+ },
+ "resources": [
+ "devfile.yaml"
+ ],
+ "starterProjects": [
+ "django-example"
+ ]
+ }
+ ]
+ },
+ {
+ "name": "nodejs-basic",
+ "displayName": "Basic NodeJS",
+ "description": "A simple Hello World application",
+ "type": "sample",
+ "tags": [
+ "NodeJS",
+ "Express"
+ ],
+ "icon": "nodejsIcon.svg",
+ "projectType": "nodejs",
+ "language": "nodejs",
+ "versions": [
+ {
+ "version": "1.0.0",
+ "schemaVersion": "2.0.0",
+ "git": {
+ "remotes": {
+ "origin": "https://github.com/redhat-developer/devfile-sample"
+ }
+ },
+ "description": "nodejs with devfile v2.0.0"
+ },
+ {
+ "version": "1.0.1",
+ "schemaVersion": "2.2.0",
+ "default": true,
+ "git": {
+ "remotes": {
+ "origin": "https://github.com/nodeshift-starters/devfile-sample"
+ }
+ },
+ "description": "nodejs with devfile v2.2.0"
+ }
+ ]
+ },
+ {
+ "name": "code-with-quarkus",
+ "displayName": "Basic Quarkus",
+ "description": "A simple Hello World Java application using Quarkus",
+ "type": "sample",
+ "tags": [
+ "Java",
+ "Quarkus"
+ ],
+ "icon": "https://raw.githubusercontent.com/elsony/devfile-sample-code-with-quarkus/main/.devfile/icon/quarkus.png",
+ "projectType": "quarkus",
+ "language": "java",
+ "provider": "Red Hat",
+ "versions": [
+ {
+ "version": "1.1.0",
+ "schemaVersion": "2.0.0",
+ "default": true,
+ "git": {
+ "remotes": {
+ "origin": "https://github.com/elsony/devfile-sample-code-with-quarkus.git"
+ }
+ },
+ "description": "java quarkus with devfile v2.0.0"
+ }
+ ]
+ }
+]
\ No newline at end of file
diff --git a/index/server/tests/registry/index_registry.json b/index/server/tests/registry/index_registry.json
new file mode 100644
index 000000000..f0050be0b
--- /dev/null
+++ b/index/server/tests/registry/index_registry.json
@@ -0,0 +1,430 @@
+[
+ {
+ "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"
+ ],
+ "projectType": "maven",
+ "language": "java",
+ "provider": "Red Hat",
+ "versions": [
+ {
+ "version": "1.1.0",
+ "schemaVersion": "2.2.0",
+ "default": true,
+ "description": "Upstream Maven and OpenJDK 11",
+ "tags": [
+ "Java",
+ "Maven"
+ ],
+ "links": {
+ "self": "devfile-catalog/java-maven:1.1.0"
+ },
+ "resources": [
+ "devfile.yaml"
+ ],
+ "starterProjects": [
+ "springbootproject"
+ ]
+ }
+ ]
+ },
+ {
+ "name": "java-openliberty",
+ "displayName": "Open Liberty",
+ "description": "Java application stack using Open Liberty runtime",
+ "type": "stack",
+ "projectType": "docker",
+ "language": "java",
+ "provider": "Red Hat",
+ "versions": [
+ {
+ "version": "0.5.0",
+ "schemaVersion": "2.2.0",
+ "default": true,
+ "description": "Java application stack using Open Liberty runtime",
+ "links": {
+ "self": "devfile-catalog/java-openliberty:0.5.0"
+ },
+ "resources": [
+ "devfile.yaml"
+ ],
+ "starterProjects": [
+ "user-app"
+ ]
+ }
+ ]
+ },
+ {
+ "name": "java-quarkus",
+ "displayName": "Quarkus Java",
+ "description": "Upstream Quarkus with Java+GraalVM",
+ "type": "stack",
+ "tags": [
+ "Java",
+ "Quarkus"
+ ],
+ "projectType": "quarkus",
+ "language": "java",
+ "provider": "Red Hat",
+ "versions": [
+ {
+ "version": "1.1.0",
+ "schemaVersion": "2.2.0",
+ "default": true,
+ "description": "Upstream Quarkus with Java+GraalVM",
+ "tags": [
+ "Java",
+ "Quarkus"
+ ],
+ "links": {
+ "self": "devfile-catalog/java-quarkus:1.1.0"
+ },
+ "resources": [
+ "devfile.yaml"
+ ],
+ "starterProjects": [
+ "community",
+ "redhat-product"
+ ]
+ }
+ ]
+ },
+ {
+ "name": "java-springboot",
+ "displayName": "Spring Boot®",
+ "description": "Spring Boot® using Java",
+ "type": "stack",
+ "tags": [
+ "Java",
+ "Spring"
+ ],
+ "icon": "https://www.eclipse.org/che/images/logo-eclipseche.svg",
+ "projectType": "spring",
+ "language": "java",
+ "versions": [
+ {
+ "version": "1.1.0",
+ "schemaVersion": "2.2.0",
+ "default": true,
+ "description": "Spring Boot® using Java",
+ "tags": [
+ "Java",
+ "Spring"
+ ],
+ "icon": "https://www.eclipse.org/che/images/logo-eclipseche.svg",
+ "links": {
+ "self": "devfile-catalog/java-springboot:1.1.0"
+ },
+ "resources": [
+ "devfile.yaml"
+ ],
+ "starterProjects": [
+ "springbootproject"
+ ]
+ }
+ ]
+ },
+ {
+ "name": "java-vertx",
+ "displayName": "Vert.x Java",
+ "description": "Upstream Vert.x using Java",
+ "type": "stack",
+ "tags": [
+ "Java",
+ "Vert.x"
+ ],
+ "projectType": "vertx",
+ "language": "java",
+ "versions": [
+ {
+ "version": "1.1.0",
+ "schemaVersion": "2.2.0",
+ "default": true,
+ "description": "Upstream Vert.x using Java",
+ "tags": [
+ "Java",
+ "Vert.x"
+ ],
+ "links": {
+ "self": "devfile-catalog/java-vertx:1.1.0"
+ },
+ "resources": [
+ "devfile.yaml"
+ ],
+ "starterProjects": [
+ "vertx-http-example",
+ "vertx-istio-circuit-breaker-booster",
+ "vertx-istio-routing-booster",
+ "vertx-secured-http-example-redhat",
+ "vertx-crud-example-redhat",
+ "vertx-istio-security-booster",
+ "vertx-crud-example",
+ "vertx-circuit-breaker-example",
+ "vertx-configmap-example",
+ "vertx-circuit-breaker-example-redhat",
+ "vertx-cache-example-redhat",
+ "vertx-cache-example",
+ "vertx-secured-http-example",
+ "vertx-health-checks-example-redhat",
+ "vertx-http-example-redhat",
+ "vertx-health-checks-example",
+ "vertx-configmap-example-redhat",
+ "vertx-messaging-work-queue-booster",
+ "vertx-istio-distributed-tracing-booster"
+ ]
+ }
+ ]
+ },
+ {
+ "name": "java-wildfly",
+ "displayName": "WildFly Java",
+ "description": "Upstream WildFly",
+ "type": "stack",
+ "tags": [
+ "Java",
+ "WildFly"
+ ],
+ "projectType": "wildfly",
+ "language": "java",
+ "versions": [
+ {
+ "version": "1.0.0",
+ "schemaVersion": "2.2.0",
+ "default": true,
+ "description": "Upstream WildFly",
+ "tags": [
+ "Java",
+ "WildFly"
+ ],
+ "links": {
+ "self": "devfile-catalog/java-wildfly:1.0.0"
+ },
+ "resources": [
+ "devfile.yaml"
+ ],
+ "starterProjects": [
+ "microprofile-config",
+ "microprofile-fault-tolerance",
+ "microprofile-health",
+ "microprofile-jwt",
+ "microprofile-metrics",
+ "microprofile-openapi",
+ "microprofile-opentracing",
+ "microprofile-rest-client"
+ ]
+ }
+ ]
+ },
+ {
+ "name": "java-wildfly-bootable-jar",
+ "displayName": "WildFly Bootable Jar",
+ "description": "Java stack with WildFly in bootable Jar mode, OpenJDK 11 and Maven 3.5",
+ "type": "stack",
+ "tags": [
+ "RHEL8",
+ "Java",
+ "OpenJDK",
+ "Maven",
+ "WildFly",
+ "Microprofile",
+ "WildFly Bootable"
+ ],
+ "projectType": "WildFly",
+ "language": "java",
+ "versions": [
+ {
+ "version": "1.0.0",
+ "schemaVersion": "2.2.0",
+ "default": true,
+ "description": "Java stack with WildFly in bootable Jar mode, OpenJDK 11 and Maven 3.5",
+ "tags": [
+ "RHEL8",
+ "Java",
+ "OpenJDK",
+ "Maven",
+ "WildFly",
+ "Microprofile",
+ "WildFly Bootable"
+ ],
+ "links": {
+ "self": "devfile-catalog/java-wildfly-bootable-jar:1.0.0"
+ },
+ "resources": [
+ "devfile.yaml"
+ ],
+ "starterProjects": [
+ "microprofile-config",
+ "microprofile-fault-tolerance",
+ "microprofile-health",
+ "microprofile-jwt",
+ "microprofile-metrics",
+ "microprofile-openapi",
+ "microprofile-opentracing",
+ "microprofile-rest-client"
+ ]
+ }
+ ]
+ },
+ {
+ "name": "nodejs",
+ "displayName": "NodeJS Runtime",
+ "description": "Stack with NodeJS 12",
+ "type": "stack",
+ "tags": [
+ "NodeJS",
+ "Express",
+ "ubi8"
+ ],
+ "projectType": "nodejs",
+ "language": "nodejs",
+ "versions": [
+ {
+ "version": "1.0.0",
+ "schemaVersion": "2.2.0",
+ "default": true,
+ "description": "Stack with NodeJS 12",
+ "tags": [
+ "NodeJS",
+ "Express",
+ "ubi8"
+ ],
+ "links": {
+ "self": "devfile-catalog/nodejs:1.0.0"
+ },
+ "resources": [
+ "archive.tar",
+ "devfile.yaml"
+ ],
+ "starterProjects": [
+ "nodejs-starter"
+ ]
+ }
+ ]
+ },
+ {
+ "name": "python",
+ "displayName": "Python",
+ "description": "Python Stack with Python 3.7",
+ "type": "stack",
+ "tags": [
+ "Python",
+ "pip"
+ ],
+ "projectType": "python",
+ "language": "python",
+ "versions": [
+ {
+ "version": "1.0.0",
+ "schemaVersion": "2.2.0",
+ "default": true,
+ "description": "Python Stack with Python 3.7",
+ "tags": [
+ "Python",
+ "pip"
+ ],
+ "links": {
+ "self": "devfile-catalog/python:1.0.0"
+ },
+ "resources": [
+ "devfile.yaml"
+ ],
+ "starterProjects": [
+ "python-example"
+ ]
+ }
+ ]
+ },
+ {
+ "name": "python-django",
+ "displayName": "Django",
+ "description": "Python3.7 with Django",
+ "type": "stack",
+ "tags": [
+ "Python",
+ "pip",
+ "Django"
+ ],
+ "projectType": "django",
+ "language": "python",
+ "versions": [
+ {
+ "version": "1.0.0",
+ "schemaVersion": "2.2.0",
+ "default": true,
+ "description": "Python3.7 with Django",
+ "tags": [
+ "Python",
+ "pip",
+ "Django"
+ ],
+ "links": {
+ "self": "devfile-catalog/python-django:1.0.0"
+ },
+ "resources": [
+ "devfile.yaml"
+ ],
+ "starterProjects": [
+ "django-example"
+ ]
+ }
+ ]
+ }
+]
\ No newline at end of file
diff --git a/index/server/tests/registry/samples/code-with-quarkus/1.1.0/devfile.yaml b/index/server/tests/registry/samples/code-with-quarkus/1.1.0/devfile.yaml
new file mode 100644
index 000000000..a77942058
--- /dev/null
+++ b/index/server/tests/registry/samples/code-with-quarkus/1.1.0/devfile.yaml
@@ -0,0 +1,71 @@
+schemaVersion: 2.0.0
+metadata:
+ name: java-quarkus
+ version: 1.1.0
+ attributes:
+ alpha.build-context: .
+ alpha.build-dockerfile: src/main/docker/Dockerfile.jvm.staged
+ website: https://quarkus.io
+ displayName: Quarkus Java
+ description: Upstream Quarkus with Java+GraalVM
+ tags: ["Java", "Quarkus"]
+ projectType: "quarkus"
+ language: "java"
+starterProjects:
+ - name: community
+ zip:
+ location: https://code.quarkus.io/d?e=io.quarkus%3Aquarkus-resteasy&e=io.quarkus%3Aquarkus-micrometer&e=io.quarkus%3Aquarkus-smallrye-health&e=io.quarkus%3Aquarkus-openshift&cn=devfile
+ - name: redhat-product
+ zip:
+ location: https://code.quarkus.redhat.com/d?e=io.quarkus%3Aquarkus-resteasy&e=io.quarkus%3Aquarkus-smallrye-health&e=io.quarkus%3Aquarkus-openshift
+components:
+ - name: buildguidance
+ attributes:
+ tool: console-import
+ container:
+ image: buildguidanceimage-placeholder
+ memoryLimit: 1024Mi
+ endpoints:
+ - name: http-8081
+ targetPort: 8081
+ - name: tools
+ container:
+ image: quay.io/eclipse/che-quarkus:nightly
+ memoryLimit: 1512Mi
+ mountSources: true
+ volumeMounts:
+ - name: m2
+ path: /home/user/.m2
+ endpoints:
+ - name: '8080-http'
+ targetPort: 8080
+ - name: m2
+ volume:
+ size: 3Gi
+commands:
+ - id: init-compile
+ exec:
+ component: tools
+ commandLine: "mvn -Dmaven.repo.local=/home/user/.m2/repository compile"
+ workingDir: $PROJECTS_ROOT
+ - id: dev-run
+ exec:
+ component: tools
+ commandLine: "mvn -Dmaven.repo.local=/home/user/.m2/repository quarkus:dev -Dquarkus.http.host=0.0.0.0 -Djava.util.logging.manager=org.jboss.logmanager.LogManager"
+ hotReloadCapable: true
+ group:
+ kind: run
+ isDefault: true
+ workingDir: $PROJECTS_ROOT
+ - id: dev-debug
+ exec:
+ component: tools
+ commandLine: "mvn -Dmaven.repo.local=/home/user/.m2/repository quarkus:dev -Dquarkus.http.host=0.0.0.0 -Djava.util.logging.manager=org.jboss.logmanager.LogManager -Ddebug=${DEBUG_PORT}"
+ hotReloadCapable: true
+ group:
+ kind: debug
+ isDefault: true
+ workingDir: $PROJECTS_ROOT
+events:
+ postStart:
+ - init-compile
diff --git a/index/server/tests/registry/samples/nodejs-basic/1.0.0/devfile.yaml b/index/server/tests/registry/samples/nodejs-basic/1.0.0/devfile.yaml
new file mode 100644
index 000000000..5fa08e605
--- /dev/null
+++ b/index/server/tests/registry/samples/nodejs-basic/1.0.0/devfile.yaml
@@ -0,0 +1,64 @@
+schemaVersion: 2.0.0
+metadata:
+ name: nodejs
+ version: 1.0.1
+ displayName: Node.js Runtime
+ description: Stack with Node.js 14
+ tags: ["NodeJS", "Express", "ubi8"]
+ projectType: "nodejs"
+ language: "nodejs"
+ attributes:
+ alpha.build-context: .
+ alpha.build-dockerfile: Dockerfile
+components:
+ - name: buildguidance
+ attributes:
+ tool: console-import
+ container:
+ image: buildguidanceimage-placeholder
+ memoryLimit: 1024Mi
+ endpoints:
+ - name: http-3001
+ targetPort: 3001
+ - name: runtime
+ container:
+ image: registry.access.redhat.com/ubi8/nodejs-14:latest
+ memoryLimit: 1024Mi
+ mountSources: true
+ sourceMapping: /project
+ endpoints:
+ - name: http-3000
+ targetPort: 3000
+commands:
+ - id: install
+ exec:
+ component: runtime
+ commandLine: npm install
+ workingDir: /project
+ group:
+ kind: build
+ isDefault: true
+ - id: run
+ exec:
+ component: runtime
+ commandLine: npm start
+ workingDir: /project
+ group:
+ kind: run
+ isDefault: true
+ - id: debug
+ exec:
+ component: runtime
+ commandLine: npm run debug
+ workingDir: /project
+ group:
+ kind: debug
+ isDefault: true
+ - id: test
+ exec:
+ component: runtime
+ commandLine: npm test
+ workingDir: /project
+ group:
+ kind: test
+ isDefault: true
diff --git a/index/server/tests/registry/samples/nodejs-basic/1.0.1/devfile.yaml b/index/server/tests/registry/samples/nodejs-basic/1.0.1/devfile.yaml
new file mode 100644
index 000000000..77164e36f
--- /dev/null
+++ b/index/server/tests/registry/samples/nodejs-basic/1.0.1/devfile.yaml
@@ -0,0 +1,43 @@
+schemaVersion: 2.2.0
+metadata:
+ name: nodejs
+ version: 1.0.1
+ displayName: Node.js Runtime
+ description: Stack with Node.js 14
+ tags: ["NodeJS", "Express", "ubi8"]
+ projectType: "nodejs"
+ language: "nodejs"
+ attributes:
+ alpha.dockerimage-port: 3001
+ provider: Red Hat
+ supportUrl: https://github.com/devfile-samples/devfile-support#support-information
+parent:
+ id: nodejs
+ registryUrl: "https://registry.devfile.io"
+components:
+ - name: outerloop-build
+ image:
+ imageName: nodejs-image:latest
+ dockerfile:
+ uri: Dockerfile
+ buildContext: .
+ rootRequired: false
+ - name: outerloop-deploy
+ kubernetes:
+ uri: outerloop-deploy.yaml
+commands:
+ - id: build-image
+ apply:
+ component: outerloop-build
+ - id: deployk8s
+ apply:
+ component: outerloop-deploy
+ - id: deploy
+ composite:
+ commands:
+ - build-image
+ - deployk8s
+ group:
+ kind: deploy
+ isDefault: true
+
diff --git a/index/server/tests/registry/stacks/go/1.1.0/devfile.yaml b/index/server/tests/registry/stacks/go/1.1.0/devfile.yaml
new file mode 100644
index 000000000..001d47077
--- /dev/null
+++ b/index/server/tests/registry/stacks/go/1.1.0/devfile.yaml
@@ -0,0 +1,47 @@
+schemaVersion: 2.0.0
+metadata:
+ description: Stack with the latest Go version with devfile v2.0.0 schema verison
+ displayName: Go Runtime
+ icon: https://raw.githubusercontent.com/devfile-samples/devfile-stack-icons/main/golang.svg
+ language: go
+ name: go
+ provider: Red Hat
+ projectType: go
+ tags:
+ - Go
+ version: 1.1.0
+starterProjects:
+ - name: go-starter
+ git:
+ checkoutFrom:
+ revision: main
+ remotes:
+ origin: https://github.com/devfile-samples/devfile-stack-go.git
+components:
+ - container:
+ endpoints:
+ - name: http
+ targetPort: 8080
+ image: golang:latest
+ memoryLimit: 1024Mi
+ mountSources: true
+ sourceMapping: /project
+ name: runtime
+commands:
+ - exec:
+ commandLine: GOCACHE=/project/.cache go build main.go
+ component: runtime
+ group:
+ isDefault: true
+ kind: build
+ workingDir: /project
+ id: build
+ - exec:
+ commandLine: ./main
+ component: runtime
+ group:
+ isDefault: true
+ kind: run
+ workingDir: /project
+ id: run
+
diff --git a/index/server/tests/registry/stacks/go/1.2.0/devfile.yaml b/index/server/tests/registry/stacks/go/1.2.0/devfile.yaml
new file mode 100644
index 000000000..a879fa8fd
--- /dev/null
+++ b/index/server/tests/registry/stacks/go/1.2.0/devfile.yaml
@@ -0,0 +1,47 @@
+schemaVersion: 2.1.0
+metadata:
+ description: Stack with the latest Go version with devfile v2.1.0 schema verison
+ displayName: Go Runtime
+ icon: https://raw.githubusercontent.com/devfile-samples/devfile-stack-icons/main/golang.svg
+ language: go
+ name: go
+ provider: Red Hat
+ projectType: go
+ tags:
+ - testtag
+ version: 1.2.0
+starterProjects:
+ - name: go-starter
+ git:
+ checkoutFrom:
+ revision: main
+ remotes:
+ origin: https://github.com/devfile-samples/devfile-stack-go.git
+components:
+ - container:
+ endpoints:
+ - name: http
+ targetPort: 8080
+ image: golang:latest
+ memoryLimit: 1024Mi
+ mountSources: true
+ sourceMapping: /project
+ name: runtime
+commands:
+ - exec:
+ commandLine: GOCACHE=/project/.cache go build main.go
+ component: runtime
+ group:
+ isDefault: true
+ kind: build
+ workingDir: /project
+ id: build
+ - exec:
+ commandLine: ./main
+ component: runtime
+ group:
+ isDefault: true
+ kind: run
+ workingDir: /project
+ id: run
+
diff --git a/index/server/tests/registry/stacks/go/stack.yaml b/index/server/tests/registry/stacks/go/stack.yaml
new file mode 100644
index 000000000..4ac2bf82a
--- /dev/null
+++ b/index/server/tests/registry/stacks/go/stack.yaml
@@ -0,0 +1,8 @@
+name: go
+description: Stack with the latest Go version
+displayName: Go Runtime
+icon: https://raw.githubusercontent.com/devfile-samples/devfile-stack-icons/main/golang.svg
+versions:
+ - version: 1.1.0
+ default: true #should have one and only one default version
+ - version: 1.2.0
diff --git a/index/server/tests/registry/stacks/java-maven/devfile.yaml b/index/server/tests/registry/stacks/java-maven/devfile.yaml
new file mode 100644
index 000000000..744702fff
--- /dev/null
+++ b/index/server/tests/registry/stacks/java-maven/devfile.yaml
@@ -0,0 +1,51 @@
+schemaVersion: 2.2.0
+metadata:
+ name: java-maven
+ version: 1.1.0
+ displayName: Maven Java
+ description: Upstream Maven and OpenJDK 11
+ tags: ["Java", "Maven"]
+ projectType: "maven"
+ language: "java"
+ provider: "Red Hat"
+starterProjects:
+ - name: springbootproject
+ git:
+ remotes:
+ origin: "https://github.com/odo-devfiles/springboot-ex.git"
+components:
+ - name: tools
+ container:
+ image: quay.io/eclipse/che-java11-maven:nightly
+ memoryLimit: 512Mi
+ mountSources: true
+ endpoints:
+ - name: 'http-8080'
+ targetPort: 8080
+ volumeMounts:
+ - name: m2
+ path: /home/user/.m2
+ - name: m2
+ volume: {}
+commands:
+ - id: mvn-package
+ exec:
+ component: tools
+ commandLine: "mvn -Dmaven.repo.local=/home/user/.m2/repository package"
+ group:
+ kind: build
+ isDefault: true
+ - id: run
+ exec:
+ component: tools
+ commandLine: "java -jar target/*.jar"
+ group:
+ kind: run
+ isDefault: true
+ - id: debug
+ exec:
+ component: tools
+ commandLine: "java -Xdebug -Xrunjdwp:server=y,transport=dt_socket,address=${DEBUG_PORT},suspend=n -jar target/*.jar"
+ group:
+ kind: debug
+ isDefault: true
\ No newline at end of file
diff --git a/index/server/tests/registry/stacks/java-openliberty/devfile.yaml b/index/server/tests/registry/stacks/java-openliberty/devfile.yaml
new file mode 100644
index 000000000..9b16a26ef
--- /dev/null
+++ b/index/server/tests/registry/stacks/java-openliberty/devfile.yaml
@@ -0,0 +1,92 @@
+# Copyright (c) 2021 IBM Corporation and others
+#
+# See the NOTICE file(s) distributed with this work for additional
+# information regarding copyright ownership.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# You may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+schemaVersion: 2.2.0
+metadata:
+ name: java-openliberty
+ version: 0.5.0
+ description: Java application stack using Open Liberty runtime
+ displayName: "Open Liberty"
+ language: "java"
+ projectType: "docker"
+ provider: "Red Hat"
+ alpha.build-dockerfile: "https://github.com/OpenLiberty/application-stack/releases/download/outer-loop-0.5.1/Dockerfile"
+ alpha.deployment-manifest: "https://github.com/OpenLiberty/application-stack/releases/download/outer-loop-0.5.1/app-deploy.yaml"
+starterProjects:
+ - name: user-app
+ git:
+ remotes:
+ origin: 'https://github.com/OpenLiberty/application-stack-starters.git'
+components:
+ - name: devruntime
+ container:
+ # In the original upstream of this devfile, the image used is openliberty/application-stack:, which is built from the repository: https://github.com/OpenLiberty/application-stack
+ image: openliberty/application-stack:0.5
+ memoryLimit: 1512Mi
+ mountSources: true
+ endpoints:
+ - exposure: public
+ path: /
+ name: ep1
+ targetPort: 9080
+ protocol: http
+commands:
+ - id: build
+ exec:
+ component: devruntime
+ commandLine: /stack/ol/scripts/devbuild-cmd.sh 21.0.0.3
+ workingDir: /projects
+ hotReloadCapable: true
+ group:
+ kind: build
+ isDefault: true
+ - id: run
+ exec:
+ component: devruntime
+ commandLine: mvn -Dliberty.runtime.version=21.0.0.3 -Ddebug=false -DhotTests=true -DcompileWait=3 liberty:dev
+ workingDir: /projects
+ hotReloadCapable: true
+ group:
+ kind: run
+ isDefault: true
+ - id: run-test-off
+ exec:
+ component: devruntime
+ commandLine: mvn -Dliberty.runtime.version=21.0.0.3 -Ddebug=false liberty:dev
+ workingDir: /projects
+ hotReloadCapable: true
+ group:
+ kind: run
+ isDefault: false
+ - id: debug
+ exec:
+ component: devruntime
+ commandLine: mvn -Dliberty.runtime.version=21.0.0.3 -DdebugPort=${DEBUG_PORT} liberty:dev -Dliberty.env.WLP_DEBUG_REMOTE=y
+ workingDir: /projects
+ hotReloadCapable: true
+ group:
+ kind: debug
+ isDefault: true
+ - id: test
+ # The 'test' command requires an active container, so we don't need to specify the liberty runtime version
+ exec:
+ component: devruntime
+ commandLine: mvn failsafe:integration-test failsafe:verify
+ workingDir: /projects
+ hotReloadCapable: true
+ group:
+ kind: test
+ isDefault: true
diff --git a/index/server/tests/registry/stacks/java-quarkus/devfile.yaml b/index/server/tests/registry/stacks/java-quarkus/devfile.yaml
new file mode 100644
index 000000000..b7746e290
--- /dev/null
+++ b/index/server/tests/registry/stacks/java-quarkus/devfile.yaml
@@ -0,0 +1,60 @@
+schemaVersion: 2.2.0
+metadata:
+ name: java-quarkus
+ version: 1.1.0
+ website: https://quarkus.io
+ displayName: Quarkus Java
+ description: Upstream Quarkus with Java+GraalVM
+ tags: ["Java", "Quarkus"]
+ projectType: "quarkus"
+ language: "java"
+ provider: "Red Hat"
+starterProjects:
+ - name: community
+ zip:
+ location: https://code.quarkus.io/d?e=io.quarkus%3Aquarkus-resteasy&e=io.quarkus%3Aquarkus-micrometer&e=io.quarkus%3Aquarkus-smallrye-health&e=io.quarkus%3Aquarkus-openshift&cn=devfile
+ - name: redhat-product
+ zip:
+ location: https://code.quarkus.redhat.com/d?e=io.quarkus%3Aquarkus-resteasy&e=io.quarkus%3Aquarkus-smallrye-health&e=io.quarkus%3Aquarkus-openshift
+components:
+ - name: tools
+ container:
+ image: quay.io/eclipse/che-quarkus:nightly
+ memoryLimit: 1512Mi
+ mountSources: true
+ volumeMounts:
+ - name: m2
+ path: /home/user/.m2
+ endpoints:
+ - name: '8080-http'
+ targetPort: 8080
+ - name: m2
+ volume:
+ size: 3Gi
+commands:
+ - id: init-compile
+ exec:
+ component: tools
+ commandLine: "mvn -Dmaven.repo.local=/home/user/.m2/repository compile"
+ workingDir: $PROJECTS_ROOT
+ - id: dev-run
+ exec:
+ component: tools
+ commandLine: "mvn -Dmaven.repo.local=/home/user/.m2/repository quarkus:dev -Dquarkus.http.host=0.0.0.0 -Djava.util.logging.manager=org.jboss.logmanager.LogManager"
+ hotReloadCapable: true
+ group:
+ kind: run
+ isDefault: true
+ workingDir: $PROJECTS_ROOT
+ - id: dev-debug
+ exec:
+ component: tools
+ commandLine: "mvn -Dmaven.repo.local=/home/user/.m2/repository quarkus:dev -Dquarkus.http.host=0.0.0.0 -Djava.util.logging.manager=org.jboss.logmanager.LogManager -Ddebug=${DEBUG_PORT}"
+ hotReloadCapable: true
+ group:
+ kind: debug
+ isDefault: true
+ workingDir: $PROJECTS_ROOT
+events:
+ postStart:
+ - init-compile
diff --git a/index/server/tests/registry/stacks/java-springboot/devfile.yaml b/index/server/tests/registry/stacks/java-springboot/devfile.yaml
new file mode 100644
index 000000000..abe0d0744
--- /dev/null
+++ b/index/server/tests/registry/stacks/java-springboot/devfile.yaml
@@ -0,0 +1,53 @@
+schemaVersion: 2.2.0
+metadata:
+ name: java-springboot
+ version: 1.1.0
+ displayName: Spring Boot®
+ description: Spring Boot® using Java
+ tags: ["Java", "Spring"]
+ globalMemoryLimit: 2674Mi
+ icon: https://www.eclipse.org/che/images/logo-eclipseche.svg
+ projectType: "spring"
+ language: "java"
+starterProjects:
+ - name: springbootproject
+ git:
+ remotes:
+ origin: "https://github.com/odo-devfiles/springboot-ex.git"
+components:
+ - name: tools
+ container:
+ image: quay.io/eclipse/che-java11-maven:nightly
+ memoryLimit: 768Mi
+ mountSources: true
+ endpoints:
+ - name: '8080-tcp'
+ targetPort: 8080
+ volumeMounts:
+ - name: m2
+ path: /home/user/.m2
+ - name: m2
+ volume:
+ size: 3Gi
+commands:
+ - id: build
+ exec:
+ component: tools
+ commandLine: "mvn clean -Dmaven.repo.local=/home/user/.m2/repository package -Dmaven.test.skip=true"
+ group:
+ kind: build
+ isDefault: true
+ - id: run
+ exec:
+ component: tools
+ commandLine: "mvn -Dmaven.repo.local=/home/user/.m2/repository spring-boot:run"
+ group:
+ kind: run
+ isDefault: true
+ - id: debug
+ exec:
+ component: tools
+ commandLine: "java -Xdebug -Xrunjdwp:server=y,transport=dt_socket,address=${DEBUG_PORT},suspend=n -jar target/*.jar"
+ group:
+ kind: debug
+ isDefault: true
\ No newline at end of file
diff --git a/index/server/tests/registry/stacks/java-vertx/devfile.yaml b/index/server/tests/registry/stacks/java-vertx/devfile.yaml
new file mode 100644
index 000000000..a3bd188c1
--- /dev/null
+++ b/index/server/tests/registry/stacks/java-vertx/devfile.yaml
@@ -0,0 +1,126 @@
+schemaVersion: 2.2.0
+metadata:
+ name: java-vertx
+ version: 1.1.0
+ displayName: Vert.x Java
+ description: Upstream Vert.x using Java
+ tags: ["Java", "Vert.x"]
+ projectType: "vertx"
+ language: "java"
+starterProjects:
+ - name: vertx-http-example
+ git:
+ remotes:
+ origin: https://github.com/openshift-vertx-examples/vertx-http-example
+ - name: vertx-istio-circuit-breaker-booster
+ git:
+ remotes:
+ origin: https://github.com/openshift-vertx-examples/vertx-istio-circuit-breaker-booster
+ - name: vertx-istio-routing-booster
+ git:
+ remotes:
+ origin: https://github.com/openshift-vertx-examples/vertx-istio-routing-booster
+ - name: vertx-secured-http-example-redhat
+ git:
+ remotes:
+ origin: https://github.com/openshift-vertx-examples/vertx-secured-http-example-redhat
+ - name: vertx-crud-example-redhat
+ git:
+ remotes:
+ origin: https://github.com/openshift-vertx-examples/vertx-crud-example-redhat
+ - name: vertx-istio-security-booster
+ git:
+ remotes:
+ origin: https://github.com/openshift-vertx-examples/vertx-istio-security-booster
+ - name: vertx-crud-example
+ git:
+ remotes:
+ origin: https://github.com/openshift-vertx-examples/vertx-crud-example
+ - name: vertx-circuit-breaker-example
+ git:
+ remotes:
+ origin: https://github.com/openshift-vertx-examples/vertx-circuit-breaker-example
+ - name: vertx-configmap-example
+ git:
+ remotes:
+ origin: https://github.com/openshift-vertx-examples/vertx-configmap-example
+ - name: vertx-circuit-breaker-example-redhat
+ git:
+ remotes:
+ origin: https://github.com/openshift-vertx-examples/vertx-circuit-breaker-example-redhat
+ - name: vertx-cache-example-redhat
+ git:
+ remotes:
+ origin: https://github.com/openshift-vertx-examples/vertx-cache-example-redhat
+ - name: vertx-cache-example
+ git:
+ remotes:
+ origin: https://github.com/openshift-vertx-examples/vertx-cache-example
+ - name: vertx-secured-http-example
+ git:
+ remotes:
+ origin: https://github.com/openshift-vertx-examples/vertx-secured-http-example
+ - name: vertx-health-checks-example-redhat
+ git:
+ remotes:
+ origin: https://github.com/openshift-vertx-examples/vertx-health-checks-example-redhat
+ - name: vertx-http-example-redhat
+ git:
+ remotes:
+ origin: https://github.com/openshift-vertx-examples/vertx-http-example-redhat
+ - name: vertx-health-checks-example
+ git:
+ remotes:
+ origin: https://github.com/openshift-vertx-examples/vertx-health-checks-example
+ - name: vertx-configmap-example-redhat
+ git:
+ remotes:
+ origin: https://github.com/openshift-vertx-examples/vertx-configmap-example-redhat
+ - name: vertx-messaging-work-queue-booster
+ git:
+ remotes:
+ origin: https://github.com/openshift-vertx-examples/vertx-messaging-work-queue-booster
+ - name: vertx-istio-distributed-tracing-booster
+ git:
+ remotes:
+ origin: https://github.com/openshift-vertx-examples/vertx-istio-distributed-tracing-booster
+components:
+ - name: runtime
+ container:
+ endpoints:
+ - exposure: public
+ path: /
+ name: '8080-tcp'
+ targetPort: 8080
+ protocol: http
+ image: quay.io/eclipse/che-java11-maven:nightly
+ memoryLimit: 512Mi
+ mountSources: true
+ volumeMounts:
+ - name: m2
+ path: /home/user/.m2
+ - name: m2
+ volume:
+ size: 3Gi
+commands:
+ - id: mvn-package
+ exec:
+ commandLine: mvn package -Dmaven.test.skip=true
+ component: runtime
+ group:
+ isDefault: true
+ kind: build
+ - id: run
+ exec:
+ commandLine: mvn io.reactiverse:vertx-maven-plugin:run
+ component: runtime
+ group:
+ isDefault: true
+ kind: run
+ - id: debug
+ exec:
+ commandLine: mvn io.reactiverse:vertx-maven-plugin:debug -Ddebug.port=${DEBUG_PORT}
+ component: runtime
+ group:
+ isDefault: true
+ kind: debug
diff --git a/index/server/tests/registry/stacks/java-wildfly-bootable-jar/devfile.yaml b/index/server/tests/registry/stacks/java-wildfly-bootable-jar/devfile.yaml
new file mode 100644
index 000000000..4b6094da4
--- /dev/null
+++ b/index/server/tests/registry/stacks/java-wildfly-bootable-jar/devfile.yaml
@@ -0,0 +1,204 @@
+schemaVersion: 2.2.0
+metadata:
+ name: java-wildfly-bootable-jar
+ version: 1.0.0
+ website: https://docs.wildfly.org/bootablejar/
+ displayName: WildFly Bootable Jar
+ description: Java stack with WildFly in bootable Jar mode, OpenJDK 11 and Maven 3.5
+ tags: ["RHEL8", "Java", "OpenJDK", "Maven", "WildFly", "Microprofile", "WildFly Bootable"]
+ projectType: "WildFly"
+ language: "java"
+starterProjects:
+ - name: microprofile-config
+ description: WildFly Eclipse Microprofile Config Quickstart
+ git:
+ checkoutFrom:
+ remote: wildfly-quickstart
+ revision: 22.0.0.Final
+ remotes:
+ wildfly-quickstart: https://github.com/wildfly/quickstart.git
+ subDir: microprofile-config
+ - name: microprofile-fault-tolerance
+ description: WildFly Eclipse Microprofile Fault Tolerance Quickstart
+ git:
+ checkoutFrom:
+ remote: wildfly-quickstart
+ revision: 22.0.0.Final
+ remotes:
+ wildfly-quickstart: https://github.com/wildfly/quickstart.git
+ subDir: microprofile-fault-tolerance
+ - name: microprofile-health
+ description: WildFly Eclipse Microprofile Health Quickstart
+ git:
+ checkoutFrom:
+ remote: wildfly-quickstart
+ revision: 22.0.0.Final
+ remotes:
+ wildfly-quickstart: https://github.com/wildfly/quickstart.git
+ subDir: microprofile-health
+ - name: microprofile-jwt
+ description: WildFly Eclipse Microprofile JWT Quickstart
+ git:
+ checkoutFrom:
+ remote: wildfly-quickstart
+ revision: 22.0.0.Final
+ remotes:
+ wildfly-quickstart: https://github.com/wildfly/quickstart.git
+ subDir: microprofile-jwt
+ - name: microprofile-metrics
+ description: WildFly Eclipse Microprofile Metrics Quickstart
+ git:
+ checkoutFrom:
+ remote: wildfly-quickstart
+ revision: 22.0.0.Final
+ remotes:
+ wildfly-quickstart: https://github.com/wildfly/quickstart.git
+ subDir: microprofile-metrics
+ - name: microprofile-openapi
+ description: WildFly Eclipse Microprofile OpenAPI Quickstart
+ git:
+ checkoutFrom:
+ remote: wildfly-quickstart
+ revision: 22.0.0.Final
+ remotes:
+ wildfly-quickstart: https://github.com/wildfly/quickstart.git
+ subDir: microprofile-openapi
+ - name: microprofile-opentracing
+ description: WildFly Eclipse Microprofile OpenTracing Quickstart
+ git:
+ checkoutFrom:
+ remote: wildfly-quickstart
+ revision: 22.0.0.Final
+ remotes:
+ wildfly-quickstart: https://github.com/wildfly/quickstart.git
+ subDir: microprofile-opentracing
+ - name: microprofile-rest-client
+ description: WildFly Eclipse Microprofile REST Client Quickstart
+ git:
+ checkoutFrom:
+ remote: wildfly-quickstart
+ revision: 22.0.0.Final
+ remotes:
+ wildfly-quickstart: https://github.com/wildfly/quickstart.git
+ subDir: microprofile-rest-client
+components:
+ - name: jaeger
+ container:
+ image: quay.io/jaegertracing/all-in-one:1.21.0
+ memoryLimit: 128Mi
+ endpoints:
+ - name: 'tracing-ui'
+ targetPort: 16686
+ - name: wildfly
+ container:
+ image: registry.access.redhat.com/ubi8/openjdk-11
+ memoryLimit: 1512Mi
+ mountSources: true
+ volumeMounts:
+ - name: m2-repository
+ path: /home/jboss/.m2/repository
+ env:
+ # Enabling Jaeger tracing
+ - name: WILDFLY_TRACING_ENABLED
+ value: 'true'
+ # Define the Jaeger service name
+ - name: JAEGER_SERVICE_NAME
+ value: 'microprofile-opentracing'
+ # Configure Jaeger traces
+ - name: JAEGER_REPORTER_LOG_SPANS
+ value: 'true'
+ - name: JAEGER_SAMPLER_TYPE
+ value: 'const'
+ - name: JAEGER_SAMPLER_PARAM
+ value: '1'
+ - name: GC_METASPACE_SIZE
+ value: '96'
+ - name: GC_MAX_METASPACE_SIZE
+ value: '256'
+ - name: JAVA_OPTS
+ value: '-Djava.security.egd=file:/dev/urandom'
+ - name: MVN_ARGS_APPEND
+ value: '-Pbootable-jar -s /home/jboss/.m2/settings.xml -Dmaven.repo.local=/home/jboss/.m2/repository -Dcom.redhat.xpaas.repo.jbossorg -Dversion.wildfly-jar.maven.plugin=3.0.1.Final'
+ endpoints:
+ - name: 'http'
+ targetPort: 8080
+ - name: m2-repository
+ volume:
+ size: 3Gi
+commands:
+ - id: build
+ exec:
+ component: wildfly
+ commandLine: mvn ${MVN_ARGS_APPEND} clean package
+ workingDir: $PROJECTS_ROOT
+ group:
+ kind: build
+ isDefault: false
+ - id: run
+ exec:
+ component: wildfly
+ commandLine: mvn ${MVN_ARGS_APPEND} org.wildfly.plugins:wildfly-jar-maven-plugin:run
+ workingDir: $PROJECTS_ROOT
+ group:
+ kind: run
+ isDefault: false
+ - id: debug
+ exec:
+ component: wildfly
+ commandLine: mvn ${MVN_ARGS_APPEND} -Dwildfly.bootable.arguments="-b=0.0.0.0" -Dwildfly.bootable.jvmArguments="-agentlib:jdwp=transport=dt_socket,address=0.0.0.0:${DEBUG_PORT},server=y,suspend=n" org.wildfly.plugins:wildfly-jar-maven-plugin:run
+ workingDir: $PROJECTS_ROOT
+ group:
+ kind: debug
+ isDefault: false
+ - id: dev-build
+ exec:
+ component: wildfly
+ commandLine: mvn ${MVN_ARGS_APPEND} -Dmaven.test.skip=true -Ddev package
+ workingDir: $PROJECTS_ROOT
+ group:
+ kind: build
+ isDefault: false
+ - id: dev-run
+ exec:
+ component: wildfly
+ commandLine: mvn ${MVN_ARGS_APPEND} -Dwildfly.bootable.arguments="-b=0.0.0.0" org.wildfly.plugins:wildfly-jar-maven-plugin:dev
+ workingDir: $PROJECTS_ROOT
+ hotReloadCapable: true
+ group:
+ kind: run
+ isDefault: false
+ - id: dev-debug
+ exec:
+ component: wildfly
+ commandLine: mvn ${MVN_ARGS_APPEND} -Dwildfly.bootable.arguments="-b=0.0.0.0" -Dwildfly.bootable.jvmArguments="-agentlib:jdwp=transport=dt_socket,address=0.0.0.0:${DEBUG_PORT},server=y,suspend=n" org.wildfly.plugins:wildfly-jar-maven-plugin:dev
+ workingDir: $PROJECTS_ROOT
+ hotReloadCapable: true
+ group:
+ kind: debug
+ isDefault: false
+ - id: watch-build
+ exec:
+ component: wildfly
+ commandLine: echo 'It's watcher mode Baby !!!''
+ workingDir: $PROJECTS_ROOT
+ group:
+ kind: build
+ isDefault: true
+ - id: watch-run
+ exec:
+ component: wildfly
+ commandLine: mvn ${MVN_ARGS_APPEND} -Dwildfly.bootable.arguments="-b=0.0.0.0" org.wildfly.plugins:wildfly-jar-maven-plugin:dev-watch -e -DskipTests
+ workingDir: $PROJECTS_ROOT
+ hotReloadCapable: true
+ group:
+ kind: run
+ isDefault: true
+ - id: watch-debug
+ exec:
+ component: wildfly
+ commandLine: mvn ${MVN_ARGS_APPEND} -Dwildfly.bootable.arguments="-b=0.0.0.0" -Dwildfly.bootable.jvmArguments="-agentlib:jdwp=transport=dt_socket,address=0.0.0.0:${DEBUG_PORT},server=y,suspend=n" org.wildfly.plugins:wildfly-jar-maven-plugin:dev-watch -e
+ workingDir: $PROJECTS_ROOT
+ hotReloadCapable: true
+ group:
+ kind: debug
+ isDefault: true
\ No newline at end of file
diff --git a/index/server/tests/registry/stacks/java-wildfly/devfile.yaml b/index/server/tests/registry/stacks/java-wildfly/devfile.yaml
new file mode 100644
index 000000000..9e95e503d
--- /dev/null
+++ b/index/server/tests/registry/stacks/java-wildfly/devfile.yaml
@@ -0,0 +1,225 @@
+schemaVersion: 2.2.0
+metadata:
+ name: java-wildfly
+ version: 1.0.0
+ website: https://wildfly.org
+ displayName: WildFly Java
+ description: Upstream WildFly
+ tags: ["Java", "WildFly"]
+ projectType: "wildfly"
+ language: "java"
+starterProjects:
+ - name: microprofile-config
+ description: WildFly Eclipse Microprofile Config Quickstart
+ git:
+ checkoutFrom:
+ remote: wildfly-quickstart
+ revision: 22.0.1.Final
+ remotes:
+ wildfly-quickstart: https://github.com/wildfly/quickstart.git
+ subDir: microprofile-config
+ - name: microprofile-fault-tolerance
+ description: WildFly Eclipse Microprofile Fault Tolerance Quickstart
+ git:
+ checkoutFrom:
+ remote: wildfly-quickstart
+ revision: 22.0.1.Final
+ remotes:
+ wildfly-quickstart: https://github.com/wildfly/quickstart.git
+ subDir: microprofile-fault-tolerance
+ - name: microprofile-health
+ description: WildFly Eclipse Microprofile Health Quickstart
+ git:
+ checkoutFrom:
+ remote: wildfly-quickstart
+ revision: 22.0.1.Final
+ remotes:
+ wildfly-quickstart: https://github.com/wildfly/quickstart.git
+ subDir: microprofile-health
+ - name: microprofile-jwt
+ description: WildFly Eclipse Microprofile JWT Quickstart
+ git:
+ checkoutFrom:
+ remote: wildfly-quickstart
+ revision: 22.0.1.Final
+ remotes:
+ wildfly-quickstart: https://github.com/wildfly/quickstart.git
+ subDir: microprofile-jwt
+ - name: microprofile-metrics
+ description: WildFly Eclipse Microprofile Metrics Quickstart
+ git:
+ checkoutFrom:
+ remote: wildfly-quickstart
+ revision: 22.0.1.Final
+ remotes:
+ wildfly-quickstart: https://github.com/wildfly/quickstart.git
+ subDir: microprofile-metrics
+ - name: microprofile-openapi
+ description: WildFly Eclipse Microprofile OpenAPI Quickstart
+ git:
+ checkoutFrom:
+ remote: wildfly-quickstart
+ revision: 22.0.1.Final
+ remotes:
+ wildfly-quickstart: https://github.com/wildfly/quickstart.git
+ subDir: microprofile-openapi
+ - name: microprofile-opentracing
+ description: WildFly Eclipse Microprofile OpenTracing Quickstart
+ git:
+ checkoutFrom:
+ remote: wildfly-quickstart
+ revision: 22.0.1.Final
+ remotes:
+ wildfly-quickstart: https://github.com/wildfly/quickstart.git
+ subDir: microprofile-opentracing
+ - name: microprofile-rest-client
+ description: WildFly Eclipse Microprofile REST Client Quickstart
+ git:
+ checkoutFrom:
+ remote: wildfly-quickstart
+ revision: 22.0.1.Final
+ remotes:
+ wildfly-quickstart: https://github.com/wildfly/quickstart.git
+ subDir: microprofile-rest-client
+components:
+ - name: wildfly
+ container:
+ image: quay.io/wildfly/wildfly-centos7:22.0
+ memoryLimit: 1512Mi
+ mountSources: true
+ volumeMounts:
+ - name: m2-repository
+ path: /home/jboss/.m2/repository
+ env:
+ - name: GC_METASPACE_SIZE
+ value: '96'
+ - name: GC_MAX_METASPACE_SIZE
+ value: '256'
+ - name: GALLEON_PROVISION_LAYERS
+ value: 'jaxrs-server,microprofile-platform'
+ - name: S2I_DESTINATION_DIR
+ value: '/projects'
+ - name: STANDALONE_RESTORE
+ value: /home/jboss/.m2/.lucky
+ - name: JBOSS_HOME
+ value: '/projects/wildfly'
+ - name: MVN_ARGS_APPEND
+ value: '-s /home/jboss/.m2/settings.xml -Dmaven.repo.local=/home/jboss/.m2/repository -Dcom.redhat.xpaas.repo.jbossorg'
+ endpoints:
+ - name: 'wildfly-http'
+ targetPort: 8080
+ - name: m2-repository
+ volume:
+ size: 3Gi
+ - name: jaeger
+ container:
+ image: quay.io/jaegertracing/all-in-one:1.21.0
+ memoryLimit: 128Mi
+ endpoints:
+ - name: 'tracing-ui'
+ targetPort: 16686
+commands:
+ - id: build
+ composite:
+ label: Build and deploy on WildFly Server
+ commands:
+ - compile
+ - copy-artifact
+ parallel: false
+ group:
+ kind: build
+ isDefault: true
+ - id: compile
+ exec:
+ label: Compile and package the application
+ component: wildfly
+ commandLine: source ${JBOSS_CONTAINER_MAVEN_DEFAULT_MODULE}/scl-enable-maven && mvn ${MVN_ARGS_APPEND} -Dmaven.test.skip=true clean package
+ workingDir: $PROJECTS_ROOT
+ group:
+ kind: build
+ isDefault: false
+ - id: copy-artifact
+ exec:
+ label: Copy application artifact
+ component: wildfly
+ commandLine: cp target/*.war $JBOSS_HOME/standalone/deployments/ROOT.war
+ workingDir: $PROJECTS_ROOT
+ group:
+ kind: build
+ isDefault: false
+ - id: run
+ exec:
+ label: Launch WildFly Server
+ component: wildfly
+ commandLine: cp -f $STANDALONE_RESTORE/standalone.xml $JBOSS_HOME/standalone/configuration/standalone.xml && $JBOSS_HOME/bin/openshift-launch.sh
+ workingDir: $PROJECTS_ROOT
+ hotReloadCapable: true
+ group:
+ kind: run
+ isDefault: true
+ - id: debug
+ exec:
+ label: Launch WildFly Server with debug enabled
+ component: wildfly
+ commandLine: cp -f $STANDALONE_RESTORE/standalone.xml $JBOSS_HOME/standalone/configuration/standalone.xml&& $JBOSS_HOME/bin/openshift-launch.sh
+ workingDir: $PROJECTS_ROOT
+ hotReloadCapable: true
+ env:
+ - name: JAVA_OPTS_APPEND
+ value: '-Xrunjdwp:transport=dt_socket,address=0.0.0.0:$DEBUG_PORT,server=y,suspend=n -Dsun.util.logging.disableCallerCheck=true'
+ group:
+ kind: debug
+ isDefault: true
+#Hack to avoid the file permissions issue with the random openshift user
+ - id: copy-galleon
+ exec:
+ component: wildfly
+ commandLine: cp -Rf /opt/jboss/container/wildfly/s2i/galleon/galleon-m2-repository /tmp/. && cp -Rf /opt/wildfly /tmp/.
+ workingDir: $PROJECTS_ROOT
+ group:
+ kind: build
+ isDefault: false
+ - id: copy-settings
+ exec:
+ component: wildfly
+ commandLine: cp ${JBOSS_CONTAINER_MAVEN_DEFAULT_MODULE}/jboss-settings.xml /tmp/settings.xml
+ workingDir: $PROJECTS_ROOT
+ group:
+ kind: build
+ isDefault: false
+ - id: provision-server
+ exec:
+ component: wildfly
+ commandLine: /usr/local/s2i/assemble && cp -Rf $JBOSS_HOME .
+ workingDir: $PROJECTS_ROOT
+ env:
+ - name: JBOSS_HOME
+ value: '/tmp/wildfly'
+ group:
+ kind: build
+ isDefault: false
+ - id: store-config
+ exec:
+ component: wildfly
+ commandLine: mkdir $STANDALONE_RESTORE && cp -f $JBOSS_HOME/standalone/configuration/standalone.xml $STANDALONE_RESTORE/standalone.xml
+ workingDir: $PROJECTS_ROOT
+ env:
+ - name: JBOSS_HOME
+ value: '/tmp/wildfly'
+ group:
+ kind: build
+ isDefault: false
+ - id: init-server
+ composite:
+ label: Provision WildFly Server
+ commands:
+ - copy-galleon
+ - provision-server
+ - store-config
+ parallel: false
+ group:
+ kind: build
+ isDefault: false
+events:
+ postStart:
+ - "init-server"
\ No newline at end of file
diff --git a/index/server/tests/registry/stacks/nodejs/archive.tar b/index/server/tests/registry/stacks/nodejs/archive.tar
new file mode 100644
index 000000000..1655dace7
Binary files /dev/null and b/index/server/tests/registry/stacks/nodejs/archive.tar differ
diff --git a/index/server/tests/registry/stacks/nodejs/devfile.yaml b/index/server/tests/registry/stacks/nodejs/devfile.yaml
new file mode 100644
index 000000000..10a813347
--- /dev/null
+++ b/index/server/tests/registry/stacks/nodejs/devfile.yaml
@@ -0,0 +1,57 @@
+schemaVersion: 2.2.0
+metadata:
+ name: nodejs
+ version: 1.0.0
+ displayName: NodeJS Runtime
+ description: Stack with NodeJS 12
+ tags: ["NodeJS", "Express", "ubi8"]
+ projectType: "nodejs"
+ language: "nodejs"
+starterProjects:
+ - name: nodejs-starter
+ git:
+ remotes:
+ origin: "https://github.com/odo-devfiles/nodejs-ex.git"
+components:
+ - name: runtime
+ container:
+ image: registry.access.redhat.com/ubi8/nodejs-14:latest
+ memoryLimit: 1024Mi
+ mountSources: true
+ sourceMapping: /project
+ endpoints:
+ - name: http-3000
+ targetPort: 3000
+commands:
+ - id: install
+ exec:
+ component: runtime
+ commandLine: npm install
+ workingDir: /project
+ group:
+ kind: build
+ isDefault: true
+ - id: run
+ exec:
+ component: runtime
+ commandLine: npm start
+ workingDir: /project
+ group:
+ kind: run
+ isDefault: true
+ - id: debug
+ exec:
+ component: runtime
+ commandLine: npm run debug
+ workingDir: /project
+ group:
+ kind: debug
+ isDefault: true
+ - id: test
+ exec:
+ component: runtime
+ commandLine: npm test
+ workingDir: /project
+ group:
+ kind: test
+ isDefault: true
diff --git a/index/server/tests/registry/stacks/python-django/devfile.yaml b/index/server/tests/registry/stacks/python-django/devfile.yaml
new file mode 100644
index 000000000..cccebc8d2
--- /dev/null
+++ b/index/server/tests/registry/stacks/python-django/devfile.yaml
@@ -0,0 +1,50 @@
+schemaVersion: 2.2.0
+metadata:
+ name: python-django
+ version: 1.0.0
+ displayName: Django
+ description: Python3.7 with Django
+ tags: ["Python", "pip", "Django"]
+ projectType: "django"
+ language: "python"
+starterProjects:
+ - name: django-example
+ git:
+ remotes:
+ origin: https://github.com/odo-devfiles/python-django-ex
+components:
+ - name: py-web
+ container:
+ image: quay.io/eclipse/che-python-3.7:nightly
+ mountSources: true
+ endpoints:
+ - name: web
+ targetPort: 8000
+commands:
+ - id: pip-install-requirements
+ exec:
+ commandLine: pip install --user -r requirements.txt
+ group:
+ kind: build
+ isDefault: true
+ component: py-web
+ - id: run-app
+ exec:
+ commandLine: "python manage.py runserver 0.0.0.0:8000"
+ workingDir: ${PROJECTS_ROOT}
+ component: py-web
+ group:
+ kind: run
+ isDefault: true
+ - id: run-migrations
+ exec:
+ commandLine: "python manage.py migrate"
+ workingDir: ${PROJECTS_ROOT}
+ component: py-web
+ - id: debug
+ exec:
+ commandLine: "pip install --user debugpy && export DEBUG_MODE=True && python -m debugpy --listen 0.0.0.0:${DEBUG_PORT} manage.py runserver 0.0.0.0:8000 --noreload --nothreading"
+ workingDir: ${PROJECTS_ROOT}
+ component: py-web
+ group:
+ kind: debug
\ No newline at end of file
diff --git a/index/server/tests/registry/stacks/python/devfile.yaml b/index/server/tests/registry/stacks/python/devfile.yaml
new file mode 100644
index 000000000..59db96483
--- /dev/null
+++ b/index/server/tests/registry/stacks/python/devfile.yaml
@@ -0,0 +1,45 @@
+schemaVersion: 2.2.0
+metadata:
+ name: python
+ version: 1.0.0
+ displayName: Python
+ description: Python Stack with Python 3.7
+ tags: ["Python", "pip"]
+ projectType: "python"
+ language: "python"
+starterProjects:
+ - name: python-example
+ git:
+ remotes:
+ origin: https://github.com/odo-devfiles/python-ex
+components:
+ - name: py-web
+ container:
+ image: quay.io/eclipse/che-python-3.7:nightly
+ mountSources: true
+ endpoints:
+ - name: web
+ targetPort: 8080
+commands:
+ - id: pip-install-requirements
+ exec:
+ commandLine: pip install --user -r requirements.txt
+ group:
+ kind: build
+ isDefault: true
+ component: py-web
+ - id: run-app
+ exec:
+ commandLine: "python app.py"
+ workingDir: ${PROJECTS_ROOT}
+ component: py-web
+ group:
+ kind: run
+ isDefault: true
+ - id: debugpy
+ exec:
+ commandLine: "pip install --user debugpy && python -m debugpy --listen 0.0.0.0:${DEBUG_PORT} app.py"
+ workingDir: ${PROJECTS_ROOT}
+ component: py-web
+ group:
+ kind: debug
diff --git a/tests/integration/pkg/tests/constants.go b/tests/integration/pkg/tests/constants.go
new file mode 100644
index 000000000..30ba29f0b
--- /dev/null
+++ b/tests/integration/pkg/tests/constants.go
@@ -0,0 +1,5 @@
+package tests
+
+const (
+ starterProjectMediaType = "application/zip"
+)
diff --git a/tests/integration/pkg/tests/indexserver_tests.go b/tests/integration/pkg/tests/indexserver_tests.go
index ffa7e7ba2..7f570fd3c 100644
--- a/tests/integration/pkg/tests/indexserver_tests.go
+++ b/tests/integration/pkg/tests/indexserver_tests.go
@@ -300,7 +300,7 @@ var _ = ginkgo.Describe("[Verify index server is working properly]", func() {
gomega.Expect(resp.StatusCode).To(gomega.Equal(http.StatusAccepted))
gomega.Expect(bytes).ToNot(gomega.BeEmpty())
gomega.Expect(bytes).To(gomega.Satisfy(func(file []byte) bool {
- return http.DetectContentType(file) == "application/zip"
+ return http.DetectContentType(file) == starterProjectMediaType
}))
})
@@ -317,7 +317,7 @@ var _ = ginkgo.Describe("[Verify index server is working properly]", func() {
gomega.Expect(resp.StatusCode).To(gomega.Equal(http.StatusAccepted))
gomega.Expect(bytes).ToNot(gomega.BeEmpty())
gomega.Expect(bytes).To(gomega.Satisfy(func(file []byte) bool {
- return http.DetectContentType(file) == "application/zip"
+ return http.DetectContentType(file) == starterProjectMediaType
}))
})
@@ -335,7 +335,7 @@ var _ = ginkgo.Describe("[Verify index server is working properly]", func() {
gomega.Expect(resp.StatusCode).To(gomega.Equal(http.StatusAccepted))
gomega.Expect(bytes).ToNot(gomega.BeEmpty())
gomega.Expect(bytes).To(gomega.Satisfy(func(file []byte) bool {
- return http.DetectContentType(file) == "application/zip"
+ return http.DetectContentType(file) == starterProjectMediaType
}))
} else {
ginkgo.Skip("cannot guarantee test outside of test registry, skipping test")
@@ -357,7 +357,7 @@ var _ = ginkgo.Describe("[Verify index server is working properly]", func() {
gomega.Expect(resp.StatusCode).To(gomega.Equal(http.StatusAccepted))
gomega.Expect(bytes).ToNot(gomega.BeEmpty())
gomega.Expect(bytes).To(gomega.Satisfy(func(file []byte) bool {
- return http.DetectContentType(file) == "application/zip"
+ return http.DetectContentType(file) == starterProjectMediaType
}))
} else {
ginkgo.Skip("cannot guarantee test outside of test registry, skipping test")
@@ -379,7 +379,7 @@ var _ = ginkgo.Describe("[Verify index server is working properly]", func() {
gomega.Expect(resp.StatusCode).To(gomega.Equal(http.StatusAccepted))
gomega.Expect(bytes).ToNot(gomega.BeEmpty())
gomega.Expect(bytes).To(gomega.Satisfy(func(file []byte) bool {
- return http.DetectContentType(file) == "application/zip"
+ return http.DetectContentType(file) == starterProjectMediaType
}))
} else {
ginkgo.Skip("cannot guarantee test outside of test registry, skipping test")