Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unifying shell code fragments in the README.md files #47

Merged
merged 1 commit into from
Apr 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions etc/scripts/RELEASE.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,34 +26,34 @@ Here is the overall procedure:

# Steps in detail

```
```shell
# Set this to the version you are releasing. This should match the released version of Helidon
export VERSION="3.0.0"
```

1. Create local release branch

```
```shell
# Checkout dev branch into release branch
git fetch origin
git checkout -b release-${VERSION} origin/dev-3.x
git log # Make sure you have what you think you have
```

2. Update Helidon version used by examples. This should be a released version of Helidon
```
```shell
etc/scripts/updatehelidonversion.sh ${VERSION}
```
3. Commit and Push local release branch to upstream to trigger release workflow.
```
```shell
mvn clean install # Do test build first
git add .
git commit
git push origin release-${VERSION}
```
4. After workflow completes check status. Check for creation of tag. Check that `helidon-3.x`
branch has been updated.
```
```shell
git fetch -t origin
# Checkout and verify branch
git checkout helidon-3.x
Expand Down
8 changes: 4 additions & 4 deletions examples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ That will quickly get you going with your first Helidon application.
After that you can come back here and dig into the examples. To access
these examples we recommend checking out from a released tag. For example:

```
```shell
git clone [email protected]:oracle/helidon.git
cd helidon
git checkout tags/2.0.0
Expand All @@ -21,7 +21,7 @@ git checkout tags/2.0.0
Our examples are Maven projects and can be built and run with
Java 11 or newer -- so make sure you have those:

```
```shell
java -version
mvn -version
```
Expand All @@ -31,14 +31,14 @@ mvn -version
Each example has a `README` that you will follow. To build most examples
just `cd` to the directory and run `mvn package`:

```
```shell
cd examples/microprofile/hello-world-explicit
mvn package
```

Usually the example will produce an application jar file that you can run:

```
```shell
java -jar target/example-name.jar
```

Expand Down
2 changes: 1 addition & 1 deletion examples/config/basics/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ containing config in HOCON (Human-Optimized Config Object Notation) format

## Build and run

```bash
```shell
mvn package
java -jar target/helidon-examples-config-basics.jar
```
2 changes: 1 addition & 1 deletion examples/config/changes/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ the most up-to-date value. Sometimes that is all you need.

## Build and run

```bash
```shell
mvn package
java -jar target/helidon-examples-config-changes.jar
```
2 changes: 1 addition & 1 deletion examples/config/git/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ checks to make sure the value is the expected `hello`.

## Build and run

```bash
```shell
mvn package
export ENVIRONMENT_NAME=test
java -jar target/helidon-examples-config-git.jar
Expand Down
2 changes: 1 addition & 1 deletion examples/config/mapping/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ system how to construct a POJO instance.

## Build and run

```bash
```shell
mvn package
java -jar target/helidon-examples-config-mapping.jar
```
2 changes: 1 addition & 1 deletion examples/config/metadata/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Example:

## Build and run

```bash
```shell
mvn package
java -jar target/helidon-examples-config-metadata.jar > application.yaml
```
2 changes: 1 addition & 1 deletion examples/config/overrides/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ take precedence over the settings in the original config sources.

## Build and run

```bash
```shell
mvn package
java -jar target/helidon-examples-config-overrides.jar
```
2 changes: 1 addition & 1 deletion examples/config/sources/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ filter.

## Build and run

```bash
```shell
mvn package
java -jar target/helidon-examples-config-sources.jar
```
20 changes: 10 additions & 10 deletions examples/cors/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ uncomment that line and then package and run the application.

## Build and run

```bash
```shell
mvn package
java -jar helidon-examples-cors.jar
```
Expand All @@ -23,7 +23,7 @@ java -jar helidon-examples-cors.jar

These normal greeting app endpoints work just as in the original greeting app:

```bash
```shell
curl -X GET http://localhost:8080/greet
{"message":"Hello World!"}

Expand All @@ -45,7 +45,7 @@ The following requests illustrate the CORS protocol with the example app.
By setting `Origin` and `Host` headers that do not indicate the same system we trigger CORS processing in the
server:

```bash
```shell
# Follow the CORS protocol for GET
curl -i -X GET -H "Origin: http://foo.com" -H "Host: here.com" http://localhost:8080/greet

Expand All @@ -63,7 +63,7 @@ Note the new headers `Access-Control-Allow-Origin` and `Vary` in the response.

The same happens for a `GET` requesting a personalized greeting (by passing the name of the
person to be greeted):
```bash
```shell
curl -i -X GET -H "Origin: http://foo.com" -H "Host: here.com" http://localhost:8080/greet/Joe
{"greeting":"Hola Joe!"}
```
Expand All @@ -83,7 +83,7 @@ The CORS protocol requires the client to send a _pre-flight_ request before send

This command sends a pre-flight `OPTIONS` request to see if the server will accept a subsequent `PUT` request from the
specified origin to change the greeting:
```bash
```shell
curl -i -X OPTIONS \
-H "Access-Control-Request-Method: PUT" \
-H "Origin: http://foo.com" \
Expand All @@ -100,7 +100,7 @@ connection: keep-alive
The successful status and the returned `Access-Control-Allow-xxx` headers indicate that the
server accepted the pre-flight request. That means it is OK for us to send `PUT` request to perform the actual change
of greeting. (See below for how the server rejects a pre-flight request.)
```bash
```shell
curl -i -X PUT \
-H "Origin: http://foo.com" \
-H "Host: here.com" \
Expand All @@ -117,7 +117,7 @@ Vary: Origin
connection: keep-alive
```
And we run one more `GET` to observe the change in the greeting:
```bash
```shell
curl -i -X GET -H "Origin: http://foo.com" -H "Host: here.com" http://localhost:8080/greet/Joe
{"greeting":"Cheers Joe!"}
```
Expand All @@ -131,7 +131,7 @@ need this feature, but the example shows how easy it is to add.

With the same server running, repeat the `OPTIONS` request from above, but change the `Origin` header to refer to
`other.com`:
```bash
```shell
curl -i -X OPTIONS \
-H "Access-Control-Request-Method: PUT" \
-H "Origin: http://other.com" \
Expand All @@ -146,12 +146,12 @@ This fails because the app set up CORS using the "restrictive-cors" configuratio
sharing only with `foo.com` and `there.com`, not with `other.com`.

Stop the running app, uncomment the commented section at the end of `application.yaml`, and build and run the app again.
```bash
```shell
mvn package
java -jar helidon-examples-cors.jar
```
Send the previous `OPTIONS` request again and note the successful result:
```bash
```shell
HTTP/1.1 200 OK
Access-Control-Allow-Methods: PUT
Access-Control-Allow-Origin: http://other.com
Expand Down
10 changes: 5 additions & 5 deletions examples/dbclient/pokemons/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,12 @@ To switch between JDBC drivers:
## Build

To build a jar file
```
```shell
mvn package
```

To build a native image (supported only with Oracle, MongoDB, or H2 databases)
```
```shell
mvn package -Pnative-image
```

Expand All @@ -53,19 +53,19 @@ Start your database before running this example.
Example docker commands to start databases in temporary containers:

Oracle:
```
```shell
docker run --rm --name xe -p 1521:1521 -p 8888:8080 wnameless/oracle-xe-11g-r2
```
For details on an Oracle Docker image, see https://github.com/oracle/docker-images/tree/master/OracleDatabase/SingleInstance

H2:
```
```shell
docker run --rm --name h2 -p 9092:9082 -p 8082:8082 nemerosa/h2
```
For details, see http://www.h2database.com/html/cheatSheet.html

MySQL:
```
```shell
docker run --rm --name mysql -p 3306:3306 -e MYSQL_ROOT_PASSWORD=root \
-e MYSQL_DATABASE=pokemon -e MYSQL_USER=user -e MYSQL_PASSWORD=password mysql:5.7
```
Expand Down
18 changes: 9 additions & 9 deletions examples/employee-app/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ The service uses Helidon DB Client that provides reactive and non-blocking acces

## Build and run

```bash
```shell
mvn package
java -jar target/employee-app.jar
```
Expand All @@ -38,7 +38,7 @@ CREATE SEQUENCE EMPLOYEE_SEQ INCREMENT BY 1 NOCACHE NOCYCLE;

## Exercise the application
Get all employees.
```sh
```shell
curl -X GET curl -X GET http://localhost:8080/employees
```

Expand All @@ -60,7 +60,7 @@ Only 1 output record is shown for brevity:


Get all employees whose last name contains "S".
```sh
```shell
curl -X GET http://localhost:8080/employees/lastname/S
```

Expand All @@ -81,7 +81,7 @@ Only 1 output record is shown for brevity:
```

Get an individual record.
```sh
```shell
curl -X GET http://localhost:8080/employees/48cf06ad-6ed4-47e6-ac44-3ea9c67cbe2d
```
Output:
Expand All @@ -108,7 +108,7 @@ http://localhost:8080/public/index.html

## Try health and metrics

```sh
```shell
curl -s -X GET http://localhost:8080/health
```

Expand Down Expand Up @@ -150,7 +150,7 @@ curl -s -X GET http://localhost:8080/health

### Prometheus Format

```sh
```shell
curl -s -X GET http://localhost:8080/metrics
```

Expand All @@ -162,7 +162,7 @@ base:classloader_current_loaded_class_count 3995
```

### JSON Format
```sh
```shell
curl -H 'Accept: application/json' -X GET http://localhost:8080/metrics
```

Expand Down Expand Up @@ -210,13 +210,13 @@ Output:

## Build the Docker Image

```sh
```shell
docker build -t employee-app .
```

## Start the application with Docker

```sh
```shell
docker run --rm -p 8080:8080 employee-app:latest
```

Expand Down
6 changes: 3 additions & 3 deletions examples/graphql/basics/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ manually creates a GraphQL Schema using the [GraphQL Java](https://github.com/gr

Start the application:

```bash
```shell
mvn package
java -jar target/helidon-examples-graphql-basics.jar
```
Expand All @@ -18,15 +18,15 @@ Probe the GraphQL endpoints:

1. Hello word endpoint:

```bash
```shell
curl -X POST http://127.0.0.1:PORT/graphql -d '{"query":"query { hello }"}'

"data":{"hello":"world"}}
```

1. Hello in different languages

```bash
```shell
curl -X POST http://127.0.0.1:PORT/graphql -d '{"query":"query { helloInDifferentLanguages }"}'

{"data":{"helloInDifferentLanguages":["Bonjour","Hola","Zdravstvuyte","Nǐn hǎo","Salve","Gudday","Konnichiwa","Guten Tag"]}}
Expand Down
6 changes: 3 additions & 3 deletions examples/grpc/basics/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,19 @@ A basic example gRPC server.

## Build and run

```bash
```shell
mvn -f ../pom.xml -pl common,basics package
java -jar target/helidon-examples-grpc-basics.jar
```

Exercise the example:
```bash
```shell
java -cp target/helidon-examples-grpc-basics.jar \
io.helidon.grpc.examples.basics.HealthClient
```

The HealthClient will give this output:
```bash
```shell
GreetService response -> status: SERVING

FooService StatusRuntimeException.getMessage() -> NOT_FOUND: Service 'FooService' does not exist or does not have a registered health check
Expand Down
Loading
Loading