-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdevfile.yaml
101 lines (98 loc) · 3.31 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
schemaVersion: 2.1.0
metadata:
generateName: spring-petclinic-
projects:
- name: spring-petclinic
git:
remotes:
origin: 'https://github.com/redhat-developer-demos/spring-petclinic.git'
checkoutFrom:
revision: main
components:
- name: maven
container:
image: 'registry.redhat.io/codeready-workspaces/plugin-java11-rhel8@sha256:641e223f5efbc32bab3461aa000e3a50a5dcca063331322158d1c959129ffd99'
volumeMounts:
- name: m2
path: /home/jboss/.m2
mountSources: true
endpoints:
- name: 8080-tcp
targetPort: 8080
memoryLimit: 768Mi
env:
- 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/jboss'
name: JAVA_OPTS
- value: $(JAVA_OPTS)
name: MAVEN_OPTS
- value: 'mysql'
name: SPRING_PROFILES_ACTIVE
- value: 'jdbc:mysql://mysql-workspace:3306/petclinic'
name: MYSQL_URL
- name: m2
volume:
size: 2Gi
- name: mysql
container:
image: registry.redhat.io/rhel8/mysql-80@sha256:55c08482a20b653dab4d78fad77b5a459e04258135e19fb14efbd1072c786fd3
memoryLimit: 512Mi
env:
- name: DATABASE_SERVICE_NAME
value: mysql-workspace
- name: MYSQL_USER
value: petclinic
- name: MYSQL_PASSWORD
value: petclinic
- name: MYSQL_ROOT_PASSWORD
value: petclinic
- name: MYSQL_DATABASE
value: petclinic
volumeMounts:
- name: mysql-storage
path: /var/lib/mysql
endpoints:
- name: mysql-workspace
targetPort: 3306
attributes:
discoverable: 'true'
public: 'false'
- name: mysql-storage
volume:
size: 2Gi
commands:
- id: 01build
exec:
component: maven
commandLine: 'MAVEN_OPTS="-Xmx200m" && mvn -Duser.home=${HOME} -DskipTests clean install'
workingDir: '${CHE_PROJECTS_ROOT}/spring-petclinic'
- id: 02compileandrun
exec:
component: maven
commandLine: 'MAVEN_OPTS="-Xmx200m" && mvn -Duser.home=${HOME} spring-boot:run'
workingDir: '${CHE_PROJECTS_ROOT}/spring-petclinic'
- id: 03runindebugmode
exec:
workingDir: '${CHE_PROJECTS_ROOT}/spring-petclinic'
commandLine: |-
mvn -Duser.home=${HOME} spring-boot:run -Dspring-boot.run.jvmArguments="-Xdebug
-Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=5005"
component: maven
- id: 04runtests
exec:
workingDir: '${CHE_PROJECTS_ROOT}/spring-petclinic'
commandLine: 'MAVEN_OPTS="-Xmx200m" && mvn -Duser.home=${HOME} verify'
component: maven
- id: 05logintodeploymentcluster
exec:
workingDir: '${CHE_PROJECTS_ROOT}/spring-petclinic'
commandLine: |
echo
echo "Before you can deploy this application to an openshift cluster,"
echo "you must run 'oc login ...' in the maven terminal."
echo
component: maven
- id: 06deploytoopenshift
exec:
workingDir: '${CHE_PROJECTS_ROOT}/spring-petclinic'
commandLine: 'mvn fabric8:deploy -Popenshift -DskipTests'
component: maven