forked from spring-projects/spring-petclinic
-
Notifications
You must be signed in to change notification settings - Fork 17
/
devfile.yaml
98 lines (90 loc) · 2.58 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
schemaVersion: 2.1.0
metadata:
name: spring-petclinic
components:
- name: tools
container:
image: quay.io/devfile/universal-developer-image:ubi8-0e189d9
memoryLimit: 3Gi
endpoints:
- exposure: none
name: debug
protocol: tcp
targetPort: 5005
- exposure: public
name: 8080-tcp
protocol: http
targetPort: 8080
volumeMounts:
- name: m2
path: /home/user/.m2
- name: m2
volume:
size: 1G
- name: mariadb
container:
image: quay.io/eclipse/che--mariadb:10.7.1-5a8009369ee57c85b6f4a08406147bd9c505cde6b8250d16a27d2a5febfdead7
memoryLimit: 300Mi
endpoints:
- exposure: none
name: db
protocol: tcp
targetPort: 3306
env:
- name: MARIADB_USER
value: petclinic
- name: MARIADB_PASSWORD
value: petclinic
- name: MARIADB_DATABASE
value: petclinic
- name: MARIADB_ALLOW_EMPTY_ROOT_PASSWORD
value: allow
- name: PS1
value: $(echo ${0}) $
volumeMounts:
- name: mysqldata
path: /var/lib/mysql
- name: mysqldata
volume:
size: 256Mi
commands:
- id: prepare-database
exec:
component: mariadb
workingDir: ${PROJECT_SOURCE}
commandLine: |
mysql -u root < ${PROJECT_SOURCE}/src/main/resources/db/mysql/user.sql && \
mysql -u root petclinic < ${PROJECT_SOURCE}/src/main/resources/db/mysql/schema.sql && \
mysql -u root petclinic < ${PROJECT_SOURCE}/src/main/resources/db/mysql/data.sql && \
echo "\e[32mDone.\e[0m Database petclinic was configured"
group:
kind: run
isDefault: true
- id: maven-build
exec:
component: tools
workingDir: ${PROJECT_SOURCE}
commandLine: mvn clean install
group:
kind: build
isDefault: true
- id: run-with-hsqldb
exec:
component: tools
workingDir: ${PROJECT_SOURCE}
commandLine: |
mvn spring-boot:run -DskipTests \
-Dspring-boot.run.jvmArguments='-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005,quiet=y'
group:
kind: run
isDefault: true
- id: run-with-mysql
exec:
component: tools
workingDir: ${PROJECT_SOURCE}
commandLine: |
mvn spring-boot:run -DskipTests -Dspring-boot.run.profiles=mysql \
-Dspring-boot.run.jvmArguments='-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005,quiet=y'
group:
kind: run
isDefault: true