Skip to content

Commit

Permalink
(#5489) Docs index - how it works
Browse files Browse the repository at this point in the history
  • Loading branch information
tdiesler committed May 10, 2024
1 parent 5380b4f commit a70af80
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 8 deletions.
3 changes: 2 additions & 1 deletion docs/local-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
# limitations under the License.
#

CW=./../../camel-website
SCRIPT_DIR=$(dirname $0)
CW=${SCRIPT_DIR}/../../camel-website
LOCAL=./../camel-k

cd $CW || (echo 'camel-website not in expected location $CW' && exit)
Expand Down
25 changes: 25 additions & 0 deletions docs/modules/ROOT/examples/yaml/helloworld.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# ---------------------------------------------------------------------------
# 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:
uri: "timer:yaml"
parameters:
period: "3000"
steps:
- setBody:
simple: "Hello world from Camel K"
- to: "log:info"
19 changes: 12 additions & 7 deletions docs/modules/ROOT/pages/index.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -24,18 +24,23 @@ Users of Camel K can instantly run integration code written in Camel DSL on thei
[[how-it-works]]
== How It Works

Just write a _helloworld.groovy_ integration file with the following content:

```groovy
from('timer:tick?period=3000')
.setBody().constant('Hello world from Camel K')
.to('log:info')
Just write a _helloworld.yaml_ integration file with the following content:

```yaml
- from:
uri: "timer:yaml"
parameters:
period: "3000"
steps:
- setBody:
simple: "Hello world from Camel K"
- to: "log:info"
```

You can then execute the following command:

```
kamel run helloworld.groovy
kamel run helloworld.yaml
```

The integration code immediately runs in the cloud. **Nothing else** is needed.
Expand Down

0 comments on commit a70af80

Please sign in to comment.