A Mirror of Spring's PetClinic
Find a file
2020-10-19 09:50:45 -04:00
.mvn/wrapper Upgrade to Maven 3.6.3 and Maven Wrapper 0.5.6 2020-06-13 14:02:26 +01:00
.vscode Add ignores for vscode 2018-02-21 09:51:59 +00:00
src Moves to autowired 2020-10-19 10:44:48 +02:00
.editorconfig Change EditorConfig to reflect some files are indented with 2 spaces 2020-06-13 14:03:04 +01:00
.gitignore Update to latest Boot and add some gitignores 2019-03-11 10:16:57 +00:00
.travis.yml Attempt to fix travis build by hardcoding Ubuntu dist 2019-06-21 12:27:16 +01:00
app-env-vars.png adding images 2020-10-13 19:46:01 -04:00
build-config.png Adds DevConsole instructions 2020-10-14 16:20:30 +02:00
clean.sh new read and clean script 2020-10-13 18:03:24 -04:00
create-project.png Adds DevConsole instructions 2020-10-14 16:20:30 +02:00
db-params.png Adds DevConsole instructions 2020-10-14 16:20:30 +02:00
db.png Adds DevConsole instructions 2020-10-14 16:20:30 +02:00
docker-compose.yml updated compose file 2020-10-13 17:31:33 -04:00
mvnw Upgrade to Maven 3.6.3 and Maven Wrapper 0.5.6 2020-06-13 14:02:26 +01:00
mvnw.cmd Upgrade to Maven 3.6.3 and Maven Wrapper 0.5.6 2020-06-13 14:02:26 +01:00
mysql-ephimeral.png Adds DevConsole instructions 2020-10-14 16:20:30 +02:00
mysql-terminal.png adding mysql terminal image 2020-10-13 19:50:20 -04:00
output-ui.png Adds DevConsole instructions 2020-10-14 16:20:30 +02:00
petclinic-deploy.png Adds DevConsole instructions 2020-10-14 16:20:30 +02:00
petclinic-url.png Adds DevConsole instructions 2020-10-14 16:20:30 +02:00
pom.xml Restore version to 2.3.0.BUILD-SNAPSHOT 2020-08-27 15:05:30 +02:00
readme.md Fix docs 2020-10-15 15:49:40 +02:00
screenshot.png adding images 2020-10-13 19:46:01 -04:00
switch-perspective.png Adds DevConsole instructions 2020-10-14 16:20:30 +02:00

Sprint PetClinic and OpenShift

Local Development

mvn package

docker-compose up

java -Dspring.profiles.active=mysql -jar target/spring-petclinic-2.3.0.BUILD-SNAPSHOT.jar 

docker exec -it spring-petclinic_mysql_1 mysql -upetclinic -ppetclinic

show databases;
use petclinic;
show tables;

+---------------------+
| Tables_in_petclinic |
+---------------------+
| owners              |
| pets                |
| specialties         |
| types               |
| vet_specialties     |
| vets                |
| visits              |
+---------------------+
7 rows in set (0.00 sec)

select * from petclinic.owners;
+----+------------+-----------+-----------------------+-------------+------------+
| id | first_name | last_name | address               | city        | telephone  |
+----+------------+-----------+-----------------------+-------------+------------+
|  1 | George     | Franklin  | 110 W. Liberty St.    | Madison     | 6085551023 |
|  2 | Betty      | Davis     | 638 Cardinal Ave.     | Sun Prairie | 6085551749 |
|  3 | Eduardo    | Rodriquez | 2693 Commerce St.     | McFarland   | 6085558763 |
|  4 | Harold     | Davis     | 563 Friendly St.      | Windsor     | 6085553198 |
|  5 | Peter      | McTavish  | 2387 S. Fair Way      | Madison     | 6085552765 |
|  6 | Jean       | Coleman   | 105 N. Lake St.       | Monona      | 6085552654 |
|  7 | Jeff       | Black     | 1450 Oak Blvd.        | Monona      | 6085555387 |
|  8 | Maria      | Escobito  | 345 Maple St.         | Madison     | 6085557683 |
|  9 | David      | Schroeder | 2749 Blackhawk Trail  | Madison     | 6085559435 |
| 10 | Carlos     | Estaban   | 2335 Independence La. | Waunakee    | 6085555487 |
| 11 | Burr       | Sutter    | 123 ABC Lane          | Wonderland  | 5555555555 |
| 12 | test       | test      | test                  | test        | 1231231321 |
+----+------------+-----------+-----------------------+-------------+------------+
12 rows in set (0.00 sec)


http://localhost:8080

Screenshot

## For OpenShift:

Dev Console

Create a new OpenShift Project with spring-petclinic-devconsole name.

Create Project

Then move to Developer perspective:

Dev Perspective

And create a new MySQL instance by clicking the +Add button and choose the Database option:

Add DB

Choose MySQL Ephimeral:

MySQL Ephimeral

and Push Instantiate Template.

Then fill the wizard with the following parameters:

MySQL Template

Push the Create button.

Let's deploy the Pet Clinic app.

Click the +Add button and choose From Git type:

Fill the Git repo with the following value https://github.com/burrsutter/spring-petclinic and select the project as Java project:

Pet Clinic Deploy

Push the Build Configuration link:

Build Configuration

Add the following environment variables for the application Pod:

DC Env Vars

Finally push the Create button and wait until the Build is done and the Pod is up and running (dark blue around the deployment bubble). Then push the Open URL button to view the Pet Clinic app:

Pet Clinic Deployment

Pet Clinic UI