Skip to content

Commit

Permalink
refactor(example): resource run option
Browse files Browse the repository at this point in the history
  • Loading branch information
squakez committed Jun 16, 2021
1 parent f0d616d commit 3198af0
Show file tree
Hide file tree
Showing 8 changed files with 63 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
// To run this integrations use:
//
// kubectl create configmap my-cm --from-literal=my-configmap-key="configmap content"
// kamel run --config configmap:my-cm configmap-route.groovy --dev
// kamel run --config configmap:my-cm config-configmap-route.groovy --dev
//

from('timer:configmap')
Expand Down
6 changes: 3 additions & 3 deletions examples/user-config/config-file-route.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@

//
// To run this integrations use:
// kamel run --config file:resources-data.txt resources-route.groovy --dev
// kamel run --config file:resources-data.txt config-file-route.groovy --dev
//

from('timer:resources')
.routeId('resources')
from('timer:config-file')
.routeId('config-file')
.setBody()
.simple("resource:classpath:resources-data.txt")
.log('resource file content is: ${body}')
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
// To run this integrations use:
//
// kubectl create secret generic my-sec --from-literal=my-secret-key="very top secret"
// kamel run --config secret:my-sec secret-route.groovy --dev
// kamel run --config secret:my-sec config-secret-route.groovy --dev
//

from('timer:secret')
Expand Down
27 changes: 27 additions & 0 deletions examples/user-config/resource-configmap-route.groovy
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
// camel-k: language=groovy
/*
* 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.
*/

//
// To run this integrations use:
//
// kubectl create configmap my-cm --from-literal=my-configmap-key="configmap content"
// kamel run --resource configmap:my-cm resource-configmap-route.groovy --dev
//

from('file:/etc/camel/data/configmaps/my-cm/?fileName=my-configmap-key&noop=true&idempotent=false')
.log('resource file content is: ${body}')
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

//
// To run this integrations use:
// kamel run --resource resources-data.txt --compression=true resources-base64-encoded-route.groovy --dev
// kamel run --resource resources-data.txt --compression=true resource-file-base64-encoded-route.groovy --dev
//

from('timer:resources-bas64')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

//
// To run this integrations use:
// kamel run --resource resources-data.zip resources-binary-route.groovy -d camel-zipfile --dev
// kamel run --resource resources-data.zip resource-file-binary-route.groovy -d camel-zipfile --dev
//

from('file:/etc/camel/resources/?fileName=resources-data.zip&noop=true&idempotent=false')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@

//
// To run this integrations use:
// kamel run --resource resources-data.txt resources-route.groovy --dev
// kamel run --resource file:resources-data.txt resource-file-route.groovy --dev
//

from('file:/etc/camel/resources/?fileName=resources-data.txt&noop=true&idempotent=false')
from('file:/etc/camel/data/resources/?fileName=resources-data.txt&noop=true&idempotent=false')
.log('resource file content is: ${body}')
27 changes: 27 additions & 0 deletions examples/user-config/resource-secret-route.groovy
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
// camel-k: language=groovy
/*
* 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.
*/

//
// To run this integrations use:
//
// kubectl create secret generic my-sec --from-literal=my-secret-key="very top secret"
// kamel run --resource secret:my-sec resource-secret-route.groovy --dev
//

from('file:/etc/camel/data/secrets/my-sec/?fileName=my-secret-key&noop=true&idempotent=false')
.log('resource file content is: ${body}')

0 comments on commit 3198af0

Please sign in to comment.