Skip to content

Commit dbab4e5

Browse files
committed
docs: convert readme to asciidoc
Signed-off-by: Otavio Santana <[email protected]>
1 parent 8610103 commit dbab4e5

File tree

1 file changed

+67
-65
lines changed

1 file changed

+67
-65
lines changed

README.adoc

Lines changed: 67 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,31 @@
1-
# intro-helidon-mongodb
1+
= intro-helidon-mongodb
22

33
Sample Helidon MP project that includes multiple REST operations.
44

5-
## Build and run
5+
== Build and run
66

7+
With JDK21:
78

8-
With JDK21
9-
```bash
9+
[source,bash]
10+
----
1011
mvn package
1112
java -jar target/intro-helidon-mongodb.jar
12-
```
13+
----
1314

14-
## Exercise the application
15+
== Exercise the application
1516

1617
Basic:
17-
```
18+
19+
[source,bash]
20+
----
1821
curl -X GET http://localhost:8080/simple-greet
1922
Hello World!
20-
```
21-
23+
----
2224

2325
JSON:
24-
```
26+
27+
[source,bash]
28+
----
2529
curl -X GET http://localhost:8080/greet
2630
{"message":"Hello World!"}
2731
@@ -32,39 +36,36 @@ curl -X PUT -H "Content-Type: application/json" -d '{"greeting" : "Hola"}' http:
3236
3337
curl -X GET http://localhost:8080/greet/Jose
3438
{"message":"Hola Jose!"}
35-
```
36-
39+
----
3740

41+
== Try health
3842

39-
## Try health
40-
41-
```
43+
[source,bash]
44+
----
4245
curl -s -X GET http://localhost:8080/health
4346
{"outcome":"UP",...
47+
----
4448

45-
```
46-
47-
48-
## Building a Native Image
49+
== Building a Native Image
4950

5051
The generation of native binaries requires an installation of GraalVM 22.1.0+.
5152

5253
You can build a native binary using Maven as follows:
5354

54-
```
55+
[source,bash]
56+
----
5557
mvn -Pnative-image install -DskipTests
56-
```
58+
----
5759

5860
The generation of the executable binary may take a few minutes to complete depending on
5961
your hardware and operating system. When completed, the executable file will be available
6062
under the `target` directory and be named after the artifact ID you have chosen during the
6163
project generation phase.
6264

65+
== Try metrics
6366

64-
65-
## Try metrics
66-
67-
```
67+
[source,bash]
68+
----
6869
# Prometheus Format
6970
curl -s -X GET http://localhost:8080/metrics
7071
# TYPE base:gc_g1_young_generation_count gauge
@@ -74,85 +75,86 @@ curl -s -X GET http://localhost:8080/metrics
7475
curl -H 'Accept: application/json' -X GET http://localhost:8080/metrics
7576
{"base":...
7677
. . .
77-
```
78-
78+
----
7979

80+
== Building the Docker Image
8081

81-
## Building the Docker Image
82-
83-
```
82+
[source,bash]
83+
----
8484
docker build -t intro-helidon-mongodb .
85-
```
85+
----
8686

87-
## Running the Docker Image
87+
== Running the Docker Image
8888

89-
```
89+
[source,bash]
90+
----
9091
docker run --rm -p 8080:8080 intro-helidon-mongodb:latest
91-
```
92+
----
9293

9394
Exercise the application as described above.
94-
9595

96-
## Run the application in Kubernetes
96+
== Run the application in Kubernetes
9797

98-
If you don’t have access to a Kubernetes cluster, you can [install one](https://helidon.io/docs/latest/#/about/kubernetes) on your desktop.
98+
If you don’t have access to a Kubernetes cluster, you can install one by following the link: https://helidon.io/docs/latest/#/about/kubernetes[install Kubernetes on your desktop].
9999

100-
### Verify connectivity to cluster
100+
=== Verify connectivity to cluster
101101

102-
```
102+
[source,bash]
103+
----
103104
kubectl cluster-info # Verify which cluster
104105
kubectl get pods # Verify connectivity to cluster
105-
```
106+
----
106107

107-
### Deploy the application to Kubernetes
108+
=== Deploy the application to Kubernetes
108109

109-
```
110+
[source,bash]
111+
----
110112
kubectl create -f app.yaml # Deploy application
111113
kubectl get pods # Wait for quickstart pod to be RUNNING
112-
kubectl get service intro-helidon-mongodb # Get service info
114+
kubectl get service intro-helidon-mongodb # Get service info
113115
kubectl port-forward service/intro-helidon-mongodb 8081:8080 # Forward service port to 8081
114-
```
116+
----
115117

116118
You can now exercise the application as you did before but use the port number 8081.
117119

118-
After you’re done, cleanup.
120+
After you’re done, cleanup:
119121

120-
```
122+
[source,bash]
123+
----
121124
kubectl delete -f app.yaml
122-
```
123-
125+
----
124126

125-
## Building a Custom Runtime Image
127+
== Building a Custom Runtime Image
126128

127-
Build the custom runtime image using the jlink image profile:
129+
Build the custom runtime image using the `jlink` image profile:
128130

129-
```
131+
[source,bash]
132+
----
130133
mvn package -Pjlink-image
131-
```
134+
----
132135

133-
This uses the helidon-maven-plugin to perform the custom image generation.
134-
After the build completes it will report some statistics about the build including the reduction in image size.
136+
This uses the `helidon-maven-plugin` to perform the custom image generation. After the build completes it will report some statistics about the build including the reduction in image size.
135137

136-
The target/intro-helidon-mongodb-jri directory is a self contained custom image of your application. It contains your application,
137-
its runtime dependencies and the JDK modules it depends on. You can start your application using the provide start script:
138+
The `target/intro-helidon-mongodb-jri` directory is a self-contained custom image of your application. It contains your application, its runtime dependencies, and the JDK modules it depends on. You can start your application using the provided start script:
138139

139-
```
140+
[source,bash]
141+
----
140142
./target/intro-helidon-mongodb-jri/bin/start
141-
```
143+
----
144+
145+
=== Class Data Sharing (CDS) Archive
142146

143-
Class Data Sharing (CDS) Archive
144147
Also included in the custom image is a Class Data Sharing (CDS) archive that improves your application’s startup
145148
performance and in-memory footprint. You can learn more about Class Data Sharing in the JDK documentation.
146149

147150
The CDS archive increases your image size to get these performance optimizations. It can be of significant size (tens of MB).
148151
The size of the CDS archive is reported at the end of the build output.
149152

150-
If you’d rather have a smaller image size (with a slightly increased startup time) you can skip the creation of the CDS
151-
archive by executing your build like this:
153+
If you’d rather have a smaller image size (with a slightly increased startup time) you can skip the creation of the CDS archive by executing your build like this:
152154

153-
```
155+
[source,bash]
156+
----
154157
mvn package -Pjlink-image -Djlink.image.addClassDataSharingArchive=false
155-
```
158+
----
156159

157-
For more information on available configuration options see the helidon-maven-plugin documentation.
158-
160+
For more information on available configuration options see the `helidon-maven-plugin` documentation.

0 commit comments

Comments
 (0)