This repository was archived by the owner on Aug 16, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 114
/
Copy pathdevfile.yaml
108 lines (108 loc) · 3.14 KB
/
devfile.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
---
apiVersion: 1.0.0
metadata:
generateName: java-mysql-
projects:
-
name: web-java-spring-petclinic
source:
type: git
location: "https://github.com/che-samples/java-spring-petclinic"
commitId: main
components:
-
type: chePlugin
id: redhat/java8/latest
-
type: dockerimage
alias: tools
image: quay.io/eclipse/che-java8-maven:next
env:
- name: MAVEN_CONFIG
value: ""
- name: JAVA_OPTS
value: "-XX:MaxRAMPercentage=50.0 -XX:+UseParallelGC -XX:MinHeapFreeRatio=10
-XX:MaxHeapFreeRatio=20 -XX:GCTimeRatio=4 -XX:AdaptiveSizePolicyWeight=90
-Dsun.zip.disableMemoryMapping=true -Xms20m -Djava.security.egd=file:/dev/./urandom
-Duser.home=/home/user"
- name: MAVEN_OPTS
value: $(JAVA_OPTS)
memoryLimit: 1000Mi
endpoints:
- name: '8080-tcp'
port: 8080
- name: 'debug'
port: 5005
attributes:
public: 'false'
mountSources: true
volumes:
- name: m2
containerPath: /home/user/.m2
-
type: dockerimage
alias: mysql
image: quay.io/eclipse/che--centos--mysql-57-centos7:latest-e08ee4d43b7356607685b69bde6335e27cf20c020f345b6c6c59400183882764
env:
- name: MYSQL_USER
value: petclinic
- name: MYSQL_PASSWORD
value: petclinic
- name: MYSQL_DATABASE
value: petclinic
- name: PS1
value: $(echo ${0})\\$
memoryLimit: 300Mi
endpoints:
- name: 'db'
port: 3306
attributes:
discoverable: "true"
public: "false"
mountSources: true
commands:
-
name: 2. Maven build
actions:
-
type: exec
component: tools
command: "mvn clean install"
workdir: "${CHE_PROJECTS_ROOT}/web-java-spring-petclinic"
-
name: 3. Run webapp
actions:
-
type: exec
component: tools
command: |
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: 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 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:
- type: vscode-launch
referenceContent: |
{
"version": "0.2.0",
"configurations": [
{
"type": "java",
"name": "Debug (Attach) - Remote",
"request": "attach",
"hostName": "localhost",
"port": 5005
}]
}