codehaus


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GitHub] nicolaferraro closed pull request #303: catalog : include camel-k components


nicolaferraro closed pull request #303: catalog : include camel-k components
URL: https://github.com/apache/camel-k/pull/303
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/deploy/camel-catalog.yaml b/deploy/camel-catalog.yaml
index f616af1b..c666a1fd 100644
--- a/deploy/camel-catalog.yaml
+++ b/deploy/camel-catalog.yaml
@@ -1831,6 +1831,15 @@ artifacts:
     - id: zookeeper-master
     languages: []
     dataformats: []
+  camel-knative:
+    groupId: org.apache.camel.k
+    artifactId: camel-knative
+    version: 0.1.1-SNAPSHOT
+    schemes:
+    - id: knative
+      http: true
+    languages: []
+    dataformats: []
   camel-juel:
     groupId: org.apache.camel
     artifactId: camel-juel
diff --git a/deploy/resources.go b/deploy/resources.go
index f1ab3815..78f7b6de 100644
--- a/deploy/resources.go
+++ b/deploy/resources.go
@@ -1875,6 +1875,15 @@ artifacts:
     - id: zookeeper-master
     languages: []
     dataformats: []
+  camel-knative:
+    groupId: org.apache.camel.k
+    artifactId: camel-knative
+    version: 0.1.1-SNAPSHOT
+    schemes:
+    - id: knative
+      http: true
+    languages: []
+    dataformats: []
   camel-juel:
     groupId: org.apache.camel
     artifactId: camel-juel
diff --git a/pkg/util/camel/catalog.go b/pkg/util/camel/catalog.go
index 579b036a..c1ad1466 100644
--- a/pkg/util/camel/catalog.go
+++ b/pkg/util/camel/catalog.go
@@ -52,10 +52,6 @@ func init() {
 	if err := yaml.Unmarshal([]byte(data), &Runtime); err != nil {
 		panic(err)
 	}
-	// Adding embedded artifacts
-	for k, v := range EmbeddedArtifacts() {
-		Runtime.Artifacts[k] = v
-	}
 
 	Runtime.artifactByScheme = make(map[string]string)
 	Runtime.schemesByID = make(map[string]Scheme)
diff --git a/pkg/util/camel/catalog_test.go b/pkg/util/camel/catalog_test.go
index d7fb0d5b..a4c47a05 100644
--- a/pkg/util/camel/catalog_test.go
+++ b/pkg/util/camel/catalog_test.go
@@ -20,6 +20,7 @@ package camel
 import (
 	"testing"
 
+	"github.com/apache/camel-k/version"
 	"github.com/stretchr/testify/assert"
 )
 
@@ -27,3 +28,15 @@ func TestCatalog(t *testing.T) {
 	assert.NotNil(t, Runtime)
 	assert.NotEmpty(t, Runtime.Artifacts)
 }
+
+func TestRuntimeContainsEmbeddedArtifacts(t *testing.T) {
+	artifact := Runtime.GetArtifactByScheme("knative")
+	assert.Equal(t, 1, len(artifact.Schemes))
+	assert.Equal(t, "org.apache.camel.k", artifact.GroupID)
+	assert.Equal(t, "camel-knative", artifact.ArtifactID)
+	assert.Equal(t, version.Version, artifact.Version)
+
+	scheme, found := Runtime.GetScheme("knative")
+	assert.True(t, found)
+	assert.True(t, scheme.HTTP)
+}
diff --git a/pkg/util/camel/embedded.go b/pkg/util/camel/embedded.go
deleted file mode 100644
index a4011cce..00000000
--- a/pkg/util/camel/embedded.go
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
-Licensed to the Apache Software Foundation (ASF) under one or more
-contributor license agreements.  See the NOTICE file distributed with
-this work for additional information regarding copyright ownership.
-The ASF licenses this file to You 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.
-*/
-
-package camel
-
-import "github.com/apache/camel-k/version"
-
-// EmbeddedArtifacts returns a list of artifacts that are shipped directly with Camel K
-func EmbeddedArtifacts() map[string]Artifact {
-	return map[string]Artifact{
-		"camel-knative": {
-			GroupID:    "org.apache.camel.k",
-			ArtifactID: "camel-knative",
-			Version:    version.Version,
-			Schemes: []Scheme{
-				{
-					ID:   "knative",
-					HTTP: true,
-				},
-			},
-		},
-	}
-}
diff --git a/runtime/catalog-builder/pom.xml b/runtime/catalog-builder/pom.xml
index 080128c0..95ff3ce4 100644
--- a/runtime/catalog-builder/pom.xml
+++ b/runtime/catalog-builder/pom.xml
@@ -46,6 +46,10 @@
         </executions>
         <configuration>
           <properties>
+            <property>
+              <name>projectVersion</name>
+              <value>${project.version}</value>
+            </property>
             <property>
               <name>catalogOutputFile</name>
               <value>${project.basedir}/../../deploy/camel-catalog.yaml</value>
diff --git a/runtime/catalog-builder/src/main/resources/catalogbuilder.groovy b/runtime/catalog-builder/src/main/resources/catalogbuilder.groovy
index 7fcdebe3..acfe2a68 100644
--- a/runtime/catalog-builder/src/main/resources/catalogbuilder.groovy
+++ b/runtime/catalog-builder/src/main/resources/catalogbuilder.groovy
@@ -108,6 +108,26 @@ catalog.findComponentNames().sort().each { name ->
     }
 }
 
+
+// *******************************
+//
+// Components :: Embedded
+//
+// *******************************
+
+output['artifacts']['camel-knative'] = [:]
+output['artifacts']['camel-knative']['groupId'] = 'org.apache.camel.k'
+output['artifacts']['camel-knative']['artifactId'] = 'camel-knative'
+output['artifacts']['camel-knative']['version'] = projectVersion
+output['artifacts']['camel-knative']['schemes'] = []
+output['artifacts']['camel-knative']['languages'] = []
+output['artifacts']['camel-knative']['dataformats'] = []
+
+output['artifacts']['camel-knative']['schemes'] << [
+    'id': 'knative',
+    'http': true,
+]
+
 // *******************************
 //
 // Languages


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@xxxxxxxxxxxxxxxx


With regards,
Apache Git Services