-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updated java workshop and converted to hugo
- Loading branch information
1 parent
f8e4b1e
commit 9567e8d
Showing
9 changed files
with
174 additions
and
20 deletions.
There are no files selected for viewing
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 11 additions & 1 deletion
12
workshops/lab-java-environment/workshop/content/00-workshop-overview.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,11 @@ | ||
This is the initial landing page for your workshop. Include in this page a description of what your workshop is about. | ||
+++ | ||
title = 'Workshop Overview' | ||
+++ | ||
|
||
The Educates training platform is a Kubernetes native application which provides | ||
time limited sandboxes for hosted workshop environments. | ||
|
||
This series of workshops demonstrates the capabilities of the Educates training | ||
platform and how it can be used. | ||
|
||
In this initial workshop you will find available Java capabilities. |
49 changes: 49 additions & 0 deletions
49
workshops/lab-java-environment/workshop/content/01-creating-an-application.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
+++ | ||
title = 'Creating an application' | ||
+++ | ||
|
||
During this workshop we will be using the command line as well as the embedded editor. The editor takes a few moments to start up and be ready, so select the **Editor** tab now to display it, or click on the action block below. | ||
|
||
```dashboard:open-dashboard | ||
name: Editor | ||
``` | ||
|
||
The first thing we need to do is create a Spring Boot application. To do this we are going to to use the `Spring Initializr` web site. | ||
|
||
The purpose of the Spring Initializr web site is to allow you to enter in details about the Spring Boot application you want to create. This includes the name of the application, the tooling you want to use, and any dependencies. When you click on generate it will automatically start a download of application source code for a Spring Boot application satisfying those requirements. You can then unpack that on your local computer and start working. | ||
|
||
Normally to do this you would go to [start.spring.io](https://start.spring.io/), however for this workshop we have integrated the web site into a tab of the workshop session dashboard. This is done so that rather than downloading the Spring Boot application you create with it to your own local machine, it will download it into the workshop environment. | ||
|
||
Select the **Initializr** tab in the workshop session dashboard. | ||
|
||
```dashboard:open-dashboard | ||
name: Initializr | ||
``` | ||
|
||
For this workshop environment you must ensure Java 17 is selected under the project metadata on Spring Initializr. | ||
|
||
Because of later commands we will run, we also want to generate a Maven project rather Gradle, so click on **Maven** under the **Project** category to select it. | ||
|
||
You can leave as is the other defaults for the project metadata as the workshop is scripted to already expect the project name to be `demo`. | ||
|
||
Now click on **Add Dependencies**, search for `Spring Reactive Web` and add it. | ||
|
||
Click again on **Add Dependencies** and this time search for `Spring Boot Actuator` and add it. | ||
|
||
We are ready to generate the Spring Boot application code. Remember you need to be using the Spring Initializr integrated into the workshop session dashboard. | ||
|
||
Click on **Create**. | ||
|
||
This should send you back to the terminal and you can see where the Spring Boot application was downloaded and extracted into the workshop environment. | ||
|
||
You can see the result by running: | ||
|
||
```terminal:execute | ||
command: tree demo | ||
``` | ||
|
||
To verify that the application code has been generated successfully, open up the main Java source code file for the application. | ||
|
||
```editor:open-file | ||
file: ~/exercises/demo/src/main/java/com/example/demo/DemoApplication.java | ||
``` |
1 change: 0 additions & 1 deletion
1
workshops/lab-java-environment/workshop/content/01-workshop-instructions.md
This file was deleted.
Oops, something went wrong.
31 changes: 31 additions & 0 deletions
31
workshops/lab-java-environment/workshop/content/02-building-the-app.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
+++ | ||
title = 'Building the application' | ||
+++ | ||
|
||
We are now ready to build the application source code. We will first do this direct into the local directory. | ||
|
||
Change to the `demo` sub directory. | ||
|
||
```terminal:execute | ||
command: cd ~/exercises/demo | ||
``` | ||
|
||
Then run Maven to start the build. | ||
|
||
```terminal:execute | ||
command: ./mvnw install | ||
``` | ||
|
||
> NOTE: It can take a couple of minutes the first time, but once the dependencies are all cached, subsequent builds would be faster. | ||
When the build has completed, build artefacts including the application JAR file, can be found in the `target` sub directory. | ||
|
||
```terminal:execute | ||
command: tree target | ||
``` | ||
|
||
To test that the application works, run Java with the application JAR file: | ||
|
||
```terminal:execute | ||
command: java -jar target/*.jar | ||
``` |
28 changes: 27 additions & 1 deletion
28
workshops/lab-java-environment/workshop/content/99-workshop-summary.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,27 @@ | ||
This is the last page of the workshop. Include in this page a summary of the workshop and any links to resources relevant to the workshop. This ensures anyone doing the workshop has material they can research later to learn more. | ||
+++ | ||
title = 'Workshop Summary' | ||
+++ | ||
|
||
This is the end of the workshop. The Educates workshop resource definition for | ||
this workshop can be viewed by clicking: | ||
|
||
```dashboard:create-dashboard | ||
name: Resource | ||
prefix: Workshop | ||
title: View workshop definition | ||
description: "" | ||
url: /files/resources/workshop.yaml | ||
``` | ||
|
||
The source code repository for this series of workshops showcasing the Educates | ||
training platform can be found at: | ||
|
||
```dashboard:open-url | ||
url: https://github.com/educates/labs-educates-showcase | ||
``` | ||
|
||
Documentation for Educates can be found at: | ||
|
||
```dashboard:open-url | ||
url: https://docs.educates.dev/ | ||
``` |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.