From 2e727ba4e1453e90f188fda4d59d1aa069f5bc70 Mon Sep 17 00:00:00 2001 From: jamesfalkner Date: Mon, 15 Jul 2019 21:32:54 -0400 Subject: [PATCH] fixes --- docs/basics.adoc | 6 +++--- docs/cloudnative.adoc | 4 ++-- docs/debugging.adoc | 2 +- docs/messaging.adoc | 2 +- docs/monitoring.adoc | 2 +- docs/native.adoc | 2 +- docs/openapi.adoc | 6 +++--- docs/panache.adoc | 4 ++-- docs/security.adoc | 22 ++++++++++++++++++++-- 9 files changed, 34 insertions(+), 16 deletions(-) diff --git a/docs/basics.adoc b/docs/basics.adoc index 58653af..ae8e415 100644 --- a/docs/basics.adoc +++ b/docs/basics.adoc @@ -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! diff --git a/docs/cloudnative.adoc b/docs/cloudnative.adoc index d099477..4f9aac0 100644 --- a/docs/cloudnative.adoc +++ b/docs/cloudnative.adoc @@ -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 diff --git a/docs/debugging.adoc b/docs/debugging.adoc index 4fc2a20..14f1a7b 100644 --- a/docs/debugging.adoc +++ b/docs/debugging.adoc @@ -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. \ No newline at end of file +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. \ No newline at end of file diff --git a/docs/messaging.adoc b/docs/messaging.adoc index 4f157d1..4ff34e6 100644 --- a/docs/messaging.adoc +++ b/docs/messaging.adoc @@ -174,7 +174,7 @@ To better understand, let’s 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! diff --git a/docs/monitoring.adoc b/docs/monitoring.adoc index f5ae1dc..156770a 100644 --- a/docs/monitoring.adoc +++ b/docs/monitoring.adoc @@ -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! diff --git a/docs/native.adoc b/docs/native.adoc index 4e72780..4e5e2ce 100644 --- a/docs/native.adoc +++ b/docs/native.adoc @@ -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! diff --git a/docs/openapi.adoc b/docs/openapi.adoc index 6eb1662..9e7d5d4 100644 --- a/docs/openapi.adoc +++ b/docs/openapi.adoc @@ -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 diff --git a/docs/panache.adoc b/docs/panache.adoc index 303655d..a123d36 100644 --- a/docs/panache.adoc +++ b/docs/panache.adoc @@ -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 diff --git a/docs/security.adoc b/docs/security.adoc index dfb713b..360ea1d 100644 --- a/docs/security.adoc +++ b/docs/security.adoc @@ -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.