diff --git a/e2e/yaks/kamelets/kamelet.feature b/e2e/yaks/kamelets/kamelet.feature new file mode 100644 index 0000000000..3f9e170590 --- /dev/null +++ b/e2e/yaks/kamelets/kamelet.feature @@ -0,0 +1,5 @@ +Feature: Camel K can run Kamelets + + Scenario: Running integration using a simple Kamelet + Given integration usage is running + Then integration usage should print Hello Kamelets diff --git a/e2e/yaks/kamelets/timer.kamelet.yaml b/e2e/yaks/kamelets/timer.kamelet.yaml new file mode 100644 index 0000000000..554e15b757 --- /dev/null +++ b/e2e/yaks/kamelets/timer.kamelet.yaml @@ -0,0 +1,37 @@ +apiVersion: camel.apache.org/v1alpha1 +kind: Kamelet +metadata: + name: timer + annotations: + camel.apache.org/kamelet.icon: timer +spec: + definition: + title: "Timer" + description: "Produces periodic events with a custom payload" + required: + - message + properties: + period: + title: Period + description: The time interval between two events + type: integer + default: 1000 + message: + title: Message + description: The message to generate + type: string + types: + out: + mediaType: application/json + schema: + id: text.camel.apache.org + type: string + flow: + from: + uri: timer:tick + parameters: + period: "{{period}}" + steps: + - set-body: + constant: "{{message}}" + - to: "direct:{{routeId}}" diff --git a/e2e/yaks/kamelets/usage.groovy b/e2e/yaks/kamelets/usage.groovy new file mode 100755 index 0000000000..d4c5de8592 --- /dev/null +++ b/e2e/yaks/kamelets/usage.groovy @@ -0,0 +1,21 @@ +// camel-k: language=groovy dependency=mvn:org.apache.camel.k:camel-kamelet:1.5.1-SNAPSHOT + +/* + * 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. + */ + +from('kamelet:timer?message=Hello+Kamelets&period=1000') + .log('${body}') diff --git a/e2e/yaks/kamelets/yaks-config.yaml b/e2e/yaks/kamelets/yaks-config.yaml new file mode 100644 index 0000000000..1df07fc397 --- /dev/null +++ b/e2e/yaks/kamelets/yaks-config.yaml @@ -0,0 +1,28 @@ +# --------------------------------------------------------------------------- +# 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. +# --------------------------------------------------------------------------- + +config: + namespace: + temporary: true +pre: +- name: installation + run: | + kamel install -n $YAKS_NAMESPACE + + kubectl apply -f timer.kamelet.yaml -n $YAKS_NAMESPACE + + kamel run usage.groovy -w -n $YAKS_NAMESPACE