This commit is contained in:
jamesfalkner
2019-07-15 21:32:54 -04:00
parent 1fa092f8e5
commit 2e727ba4e1
9 changed files with 34 additions and 16 deletions

View File

@@ -110,7 +110,7 @@ You should see `hello` in your browser tab, which means its working!
image::hellopage.png[hello,800]
Now, let's exercise the **live reload** capabilities of Quarkus. In Che, open the `GreetingResource.java` file (in `src/main/java/org/acme/people/rest`) and change `return "hello";` to `return "hola";` in the editor. Press `CTRL-S` (or `CMD-S` on Mac OS) to save the file. Don't recompile or restart anything. Just try to reload the same brower tab that was showing `hello`. It should now show `hola`.
Now, let's exercise the **live reload** capabilities of Quarkus. In Che, open the `GreetingResource.java` file (in `src/main/java/org/acme/people/rest`) and change `return "hello";` to `return "hola";` in the editor. Press kbd:[Control+S] (or kbd:[Command+S] on Mac OS) to save the file. Don't recompile or restart anything. Just try to reload the same brower tab that was showing `hello`. It should now show `hola`.
Wow, how cool is that? Supersonic Subatomic live reload! Go ahead and change it a few more times and access the endpoint again. And we're just getting started. Leave the app running so we can continue to change it on the fly in the next section.
@@ -126,7 +126,7 @@ This will also listen for a debugger on port `5005`. If your want to wait for th
### Stop the previous application
Let's stop the original application so we can package and re-run it as an executable JAR. In the terminal, press `CTRL-C` to stop the application (some browsers don't support this command - simply close the Terminal using the 'X' button on the tab, which will also kill the running app).
Let's stop the original application so we can package and re-run it as an executable JAR. In the terminal, press kbd:[CTRL+C] to stop the application (**some browsers don't support this command** - simply close the Terminal using the kbd:[X] button on the tab, which will also kill the running app).
image::kill.png[kill,800]
@@ -172,7 +172,7 @@ hola
## Cleanup
Go back to the terminal in which you ran the app and stop the app by pressing `CTRL-C` (or close the Terminal).
Go back to the terminal in which you ran the app and stop the app by pressing kbd:[CTRL+C] (or close the Terminal).
## Congratulations!

View File

@@ -404,7 +404,7 @@ curl http://localhost:8080/hello
produces `hello quarkus!`.
Next, CTRL-C it (or close the "Build and Run Locally" Terminal window). We need to re-build the app as an executable JAR so it runs with the `prod` profile.
Next, kbd:[CTRL+C] it (or close the "Build and Run Locally" Terminal window). We need to re-build the app as an executable JAR so it runs with the `prod` profile.
Build an executable JAR just as before using the command palette and choosing **Create Executable JAR**.
@@ -433,7 +433,7 @@ In this example we read configuration properties from `application.properties`.
## Cleanup
Stop the app for now by pressing CTRL-C in the terminal or closing the Terminal window in which the app runs.
Stop the app for now by pressing kbd:[CTRL+C] in the terminal or closing the Terminal window in which the app runs.
## Congratulations

View File

@@ -125,4 +125,4 @@ Quarkus apps are just like any other Java app, so debugging is straightforward a
## Cleanup
Go back to your Terminals and stop the app for now by pressing CTRL-C in the terminal or closing the Terminal window in which the app runs.
Go back to your Terminals and stop the app for now by pressing kbd:[CTRL+C] in the terminal or closing the Terminal window in which the app runs.

View File

@@ -174,7 +174,7 @@ To better understand, lets detail how the HTTP request/response has been hand
## Cleanup
Stop the app for now by pressing CTRL-C in the terminal or closing the Terminal window in which the app runs.
Stop the app for now by pressing kbd:[CTRL+C] in the terminal or closing the Terminal window in which the app runs.
## Congratulations!

View File

@@ -234,7 +234,7 @@ If you have time after completing this workshop, try running grafana and hooking
## Cleanup
Go to the first Terminal tab and press `CTRL-C` to stop our locally running app (or close the Terminal window).
Go to the first Terminal tab and press kbd:[CTRL+C] to stop our locally running app (or close the Terminal window).
## Congratulations!

View File

@@ -120,7 +120,7 @@ Nice!
## Cleanup
Go to the first Terminal tab and press `CTRL-C` to stop our native app (or close the Terminal window).
Go to the first Terminal tab and press kbd:[CTRL+C] to stop our native app (or close the Terminal window).
## Congratulations!

View File

@@ -14,7 +14,7 @@ Therefore you as a developer get a _lot_ of functionality out of the box without
## Out of the box APIs
If your application is still running from the previous exercise, go back to its terminal and type CTRL-C (or just close the terminal window). We need to add another extension for OpenAPI. Run the following command:
If your application is still running from the previous exercise, go back to its terminal and type kbd:[CTRL+C] (or just close the terminal window). We need to add another extension for OpenAPI. Run the following command:
[source,sh,role="copypaste"]
----
@@ -23,7 +23,7 @@ mvn quarkus:add-extension -Dextensions="openapi"
This will add the extension to our project.
Run the project again, using the command palette and selecting **Build and Run Locally** (if you had a previous app running, CTRL-C or close the old Terminal before running it again). This will again run our app. Once it's up and running, access the new `openapi` endpoint using the following command in a Terminal:
Run the project again, using the command palette and selecting **Build and Run Locally** (if you had a previous app running, kbd:[CTRL+C] or close the old Terminal before running it again). This will again run our app. Once it's up and running, access the new `openapi` endpoint using the following command in a Terminal:
[source,sh,role="copypaste"]
----
@@ -174,7 +174,7 @@ image::swaggerparams.png[swaggerparams,600]
## Cleanup
Stop the app for now by pressing CTRL-C in the terminal or closing the Terminal window in which the app runs.
Stop the app for now by pressing kbd:[CTRL+C] in the terminal or closing the Terminal window in which the app runs.
## Congratulations

View File

@@ -178,7 +178,7 @@ These statements will add some fake people to our database on startup.
### Run the application
Now we are ready to run our application. Using the command palette, select **Build and Run Locally** (if you had a previous app running, CTRL-C or close the old Terminal before running it again). You should see a bunch of log output that ends with:
Now we are ready to run our application. Using the command palette, select **Build and Run Locally** (if you had a previous app running, kbd:[CTRL+C] or close the old Terminal before running it again). You should see a bunch of log output that ends with:
[source, none]
----
@@ -526,7 +526,7 @@ Note the values for `recordsFiltered` (the number of records with the letter `F`
## Cleanup
We're done with development, so go back to the first Terminal tab and press `CTRL-C` (or just close the running tab) to stop our running application.
We're done with development, so go back to the first Terminal tab and press kbd:[CTRL+C] (or just close the running tab) to stop our running application.
## Deploy to OpenShift

View File

@@ -177,7 +177,7 @@ curl -i http://$(oc get route people -o=go-template --template='{{ .spec.host }}
You should see:
[source,json]
[source,none]
----
HTTP/1.1 200 OK
Connection: keep-alive
@@ -320,11 +320,29 @@ public class KeycloakResource {
[NOTE]
====
There are other APIs you can use if you try to auto-complete the method name using Che, e.g. `getBirthDate()` or `getPicture()`. Place the cursor just after `keycloakSecurityContext.getToken().get` and press CTRL-SPACE to see them:
There are other APIs you can use if you try to auto-complete the method name using Che, e.g. `getBirthDate()` or `getPicture()`. Place the cursor just after `keycloakSecurityContext.getToken().get` and press kbd:[Ctrl+Space] to see them:
image::secapis.png[apis, 800]
====
## Rebuild and redeploy app
First, re-build the app using the command palette and selecting **Create Executable JAR**. Once that's done, run the following command to re-deploy:
[source,sh,role="copypaste"]
----
oc start-build people --from-file target/*-runner.jar --follow
----
## Confirm deployment
Run and wait for the app to complete its rollout:
[source,sh,role="copypaste"]
----
oc rollout status -w dc/people
----
### Test confidential
The `/secured/confidential` endpoint is protected with a policy defined in the Keycloak Server. The policy only grants access to the resource if the user is granted with a `confidential` role. The difference here is that the application is delegating the access decision to Keycloak, so no explicit source code instrumentation is required.