This application demonstrates simple examples for how to use Spring Boot, Spring MVC and Spring for REST APIs and Spring Service.
A Lab or Workshop accompanies this application:
- Setup and configuration instructions, see labs/exercise-7/README0.md,
- Lab: Deploying a Spring Boot App using with Jenkinsfile Using Source-to-Image (S2I) in Jenkings on Openshift, see labs/exercise-7/README.md,
- Extra: Indepth Review of the Jenkinsfile,
Using the Maven Wrapper,
user@host:~$ ./mvnw clean install
user@host:~$ ./mvnw spring-boot:run
Without Maven Wrapper,
user@host:~$ mvn clean install
user@host:~$ mvn spring-boot:run
user@host:~$ curl -X GET 'http://localhost:8080/api/hello?name=pluto'
To download all dependencies for development, run
user@host:~$ mvn dependency:copy-dependencies
The Jenkinsfile
is written for a Source-to-Image (S2I) deployment to OpenShift 3.11.
Lab coming soon...
See Java: Get Started with Spring Boot and Java: Create a Spring MVC App with Tomcat and Maven for a tutorial on Spring Boot and Spring MVC.
- Replace the 'oc' syntax for the OpenShift command line interface (CLI) by the syntax used for the OpenShift Jenkins Pipeline (DSL) Plugin.
- Another TODO, add an
openshift.selector().exists()
condition, before deleting. Currently there is manual step required to make sure the project exists. In addition, if deleting the project resources has not completed fully, the create project will also become an issue. In other words, not fool proof right now. - The
oc new-app
takes a full path URI to the base image, but there has to be a way to reference this by tag and perhaps use theoc import-image
as a separate step to make sure it exists. Didn't have time to fix this part.