Skip to content
This repository was archived by the owner on Aug 16, 2024. It is now read-only.

fix: update java mysql devfile #454

Merged
merged 2 commits into from
Jul 28, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 8 additions & 10 deletions devfiles/java-mysql/devfile.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ projects:
source:
type: git
location: "https://github.com/che-samples/java-spring-petclinic"
commitId: 93873665453584deb891569c02e3acc7283cf394
branch: main
components:
-
type: chePlugin
Expand Down Expand Up @@ -62,36 +62,34 @@ components:
mountSources: true
commands:
-
name: maven build
name: 2. Maven build
actions:
-
type: exec
component: tools
command: "mvn clean install"
workdir: "${CHE_PROJECTS_ROOT}/web-java-spring-petclinic"
-
name: run webapp
name: 3. Run webapp
actions:
-
type: exec
component: tools
command: |
SPRING_DATASOURCE_URL=jdbc:mysql://db/petclinic \
SPRING_DATASOURCE_USERNAME=petclinic \
SPRING_DATASOURCE_PASSWORD=petclinic \
java -jar -Dspring.profiles.active=mysql \
java -jar -Dspring-boot.run.profiles=mysql \
-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5005 \
target/*.jar
workdir: ${CHE_PROJECTS_ROOT}/web-java-spring-petclinic
-
name: prepare database
name: 1. Prepare database
actions:
-
type: exec
component: mysql
command: |
/opt/rh/rh-mysql57/root/usr/bin/mysql -u root < ${CHE_PROJECTS_ROOT}/web-java-spring-petclinic/src/main/resources/db/mysql/user.sql &&
/opt/rh/rh-mysql57/root/usr/bin/mysql -u root petclinic < ${CHE_PROJECTS_ROOT}/web-java-spring-petclinic/src/main/resources/db/mysql/schema.sql &&
/opt/rh/rh-mysql57/root/usr/bin/mysql -u root < ${CHE_PROJECTS_ROOT}/web-java-spring-petclinic/src/main/resources/db/mysql/user.sql && \
/opt/rh/rh-mysql57/root/usr/bin/mysql -u root petclinic < ${CHE_PROJECTS_ROOT}/web-java-spring-petclinic/src/main/resources/db/mysql/schema.sql && \
/opt/rh/rh-mysql57/root/usr/bin/mysql -u root petclinic < ${CHE_PROJECTS_ROOT}/web-java-spring-petclinic/src/main/resources/db/mysql/data.sql && \
echo -e "\e[32mDone.\e[0m Database petclinic was configured!"
- name: Debug remote java application
actions:
Expand Down