forked from redhat-developer-demos/spring-petclinic
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdevfile.yaml
119 lines (119 loc) · 3.85 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
109
110
111
112
113
114
115
116
117
118
119
apiVersion: 2.0.0
metadata:
generateName: spring-petclinic-
projects:
- name: spring-petclinic
source:
type: git
location: 'https://github.com/redhat-developer-demos/spring-petclinic.git'
branch: main
components:
- id: redhat/java11/latest
type: chePlugin
- id: redhat/dependency-analytics/latest
type: chePlugin
- id: redhat/vscode-openshift-connector/latest
type: chePlugin
- mountSources: true
endpoints:
- name: 8080-tcp
port: 8080
memoryLimit: 768Mi
type: dockerimage
volumes:
- name: m2
containerPath: /home/jboss/.m2
alias: maven
image: 'registry.redhat.io/codeready-workspaces/plugin-java11-rhel8@sha256:641e223f5efbc32bab3461aa000e3a50a5dcca063331322158d1c959129ffd99'
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
- type: dockerimage
alias: mysql
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
volumes:
- name: mysql-storage
containerPath: /var/lib/mysql
endpoints:
- name: mysql-workspace
port: 3306
attributes:
discoverable: 'true'
public: 'false'
commands:
- name: 1. Build
actions:
- workdir: '${CHE_PROJECTS_ROOT}/spring-petclinic'
type: exec
command: 'MAVEN_OPTS="-Xmx200m" && mvn -Duser.home=${HOME} -DskipTests clean install'
component: maven
- name: 2. Run
actions:
- workdir: '${CHE_PROJECTS_ROOT}/spring-petclinic'
type: exec
command: 'MAVEN_OPTS="-Xmx200m" && mvn -Duser.home=${HOME} spring-boot:run'
component: maven
- name: 3. Run in debug mode
actions:
- workdir: '${CHE_PROJECTS_ROOT}/spring-petclinic'
type: exec
command: |-
mvn -Duser.home=${HOME} spring-boot:run -Dspring-boot.run.jvmArguments="-Xdebug
-Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=5005"
component: maven
- name: 4. Run tests
actions:
- workdir: '${CHE_PROJECTS_ROOT}/spring-petclinic'
type: exec
command: 'MAVEN_OPTS="-Xmx200m" && mvn -Duser.home=${HOME} verify'
component: maven
- name: 5. Log into deployment cluster
actions:
- workdir: '${CHE_PROJECTS_ROOT}/spring-petclinic'
type: exec
command: |
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
- name: 6. Deploy to OpenShift
actions:
- workdir: '${CHE_PROJECTS_ROOT}/spring-petclinic'
type: exec
command: 'mvn fabric8:deploy -Popenshift -DskipTests'
component: maven
- name: Debug remote java application
actions:
- referenceContent: |
{
"version": "0.2.0",
"configurations": [
{
"type": "java",
"name": "Debug (Attach) - Remote",
"request": "attach",
"hostName": "localhost",
"port": 5005
}]
}
type: vscode-launch