Skip to content

Commit

Permalink
(apache#56) Update generic modeline
Browse files Browse the repository at this point in the history
  • Loading branch information
tdiesler committed May 22, 2024
1 parent 97b694d commit 6ebf898
Show file tree
Hide file tree
Showing 15 changed files with 157 additions and 185 deletions.
15 changes: 14 additions & 1 deletion generic-examples/modeline/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
# Modeline Camel K examples

Find useful examples about how to use Modeline in a Camel K integration.
Find useful examples about how to use Modeline in a Camel K integration.

```
kamel run --dev modeline-build-property-route.yaml
kamel run --dev modeline-build-property-file-route.yaml
kamel run --dev modeline-property-route.yaml
kamel run --dev modeline-property-file-route.yaml
kubectl create secret generic my-sec --from-literal=my-secret-key="very top secret"
kamel run --dev modeline-config-secret-route.yaml
```
4 changes: 3 additions & 1 deletion generic-examples/modeline/SampleModeline.java
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// camel-k: dependency=mvn:com.google.guava:guava:28.0-jre
// camel-k: language=java

/*
* Licensed to the Apache Software Foundation (ASF) under one or more
Expand All @@ -17,6 +17,8 @@
* limitations under the License.
*/

// camel-k: dependency=mvn:com.google.guava:guava:28.0-jre

import org.apache.camel.builder.RouteBuilder;

public class SampleModeline extends RouteBuilder {
Expand Down

This file was deleted.

27 changes: 27 additions & 0 deletions generic-examples/modeline/modeline-build-property-file-route.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# camel-k: language=yaml

# ---------------------------------------------------------------------------
# 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.
# ---------------------------------------------------------------------------

# camel-k: build-property=file:quarkus.properties

- from:
uri: "timer:build-property"
steps:
- setBody:
simple: "The application name: {{quarkus.application.name}}"
- to: "log:info"
31 changes: 0 additions & 31 deletions generic-examples/modeline/modeline-build-property-route.groovy

This file was deleted.

27 changes: 27 additions & 0 deletions generic-examples/modeline/modeline-build-property-route.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# camel-k: language=yaml

# ---------------------------------------------------------------------------
# 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.
# ---------------------------------------------------------------------------

# camel-k: build-property=quarkus.application.name=my-super-application

- from:
uri: "timer:build-property"
steps:
- setBody:
simple: "The application name: {{quarkus.application.name}}"
- to: "log:info"
30 changes: 0 additions & 30 deletions generic-examples/modeline/modeline-config-file-route.groovy

This file was deleted.

32 changes: 0 additions & 32 deletions generic-examples/modeline/modeline-config-secret-route.groovy

This file was deleted.

30 changes: 30 additions & 0 deletions generic-examples/modeline/modeline-config-secret-route.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# camel-k: language=yaml

# ---------------------------------------------------------------------------
# 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.
# ---------------------------------------------------------------------------

# camel-k: config=secret:my-sec

- from:
uri: "timer:secret"
steps:
- setBody:
simple: "resource:classpath:my-secret-key"
- setBody:
simple: "secret content is: ${body}"
- to: "log:info"

29 changes: 0 additions & 29 deletions generic-examples/modeline/modeline-property-file-route.groovy

This file was deleted.

27 changes: 27 additions & 0 deletions generic-examples/modeline/modeline-property-file-route.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# camel-k: language=yaml

# ---------------------------------------------------------------------------
# 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.
# ---------------------------------------------------------------------------

# camel-k: property=file:my.properties

- from:
uri: "timer:property-file"
steps:
- setBody:
simple: "property file content is: {{my.key.1}} {{my.key.2}}"
- to: "log:info"
29 changes: 0 additions & 29 deletions generic-examples/modeline/modeline-property-route.groovy

This file was deleted.

27 changes: 27 additions & 0 deletions generic-examples/modeline/modeline-property-route.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# camel-k: language=yaml

# ---------------------------------------------------------------------------
# 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.
# ---------------------------------------------------------------------------

# camel-k: property=my.message=test-property

- from:
uri: "timer:property"
steps:
- setBody:
simple: "property content is: {{my.message}}"
- to: "log:info"
2 changes: 2 additions & 0 deletions generic-examples/modeline/my.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
my.key.1=hello
my.key.2=world
1 change: 0 additions & 1 deletion generic-examples/modeline/resources-data.txt

This file was deleted.

0 comments on commit 6ebf898

Please sign in to comment.