-
Notifications
You must be signed in to change notification settings - Fork 96
/
devfile.yaml
153 lines (152 loc) · 4.87 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
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
apiVersion: 1.0.0
metadata:
name: manuela-dev
projects:
- name: manuela-dev
source:
location: 'git@github.com:sa-mw-dach/manuela-dev'
type: git
branch: master
components:
- id: redhat/java8/latest
type: chePlugin
- id: redhat/dependency-analytics/latest
type: chePlugin
- id: che-incubator/typescript/latest
memoryLimit: 512Mi
type: chePlugin
- id: redhat/vscode-yaml/latest
type: chePlugin
- alias: amq
type: dockerimage
memoryLimit: 2048Mi
image: 'registry.redhat.io/amq7/amq-broker:7.5'
mountSources: false
endpoints:
- name: 61616/tcp
port: 61616
env:
- name: AMQ_USER
value: iotuser
- name: AMQ_PASSWORD
value: iotuser
- mountSources: true
endpoints:
- name: nodejs
port: 3000
memoryLimit: 512Mi
type: dockerimage
alias: iot-consumer
image: 'registry.redhat.io/codeready-workspaces/stacks-node-rhel8:2.0'
- mountSources: true
endpoints:
- name: iot-frontend
port: 8100
memoryLimit: 2048Mi
type: dockerimage
alias: iot-frontend
image: 'registry.redhat.io/codeready-workspaces/stacks-node-rhel8:2.0'
- mountSources: true
endpoints:
- name: 8080/tcp
port: 8080
memoryLimit: 768Mi
type: dockerimage
volumes:
- name: m2
containerPath: /home/jboss/.m2
alias: iot-software-sensor
image: 'registry.redhat.io/codeready-workspaces/stacks-java-rhel8:2.0'
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
commands:
- name: build
actions:
- workdir: '${CHE_PROJECTS_ROOT}/manuela-dev/components/iot-software-sensor'
type: exec
command: 'MAVEN_OPTS="-Xmx200m" && mvn -Duser.home=${HOME} -DskipTests clean install'
component: iot-software-sensor
- name: run
actions:
- workdir: '${CHE_PROJECTS_ROOT}/manuela-dev/components/iot-software-sensor'
type: exec
command: 'MAVEN_OPTS="-Xmx200m" && mvn -Duser.home=${HOME} spring-boot:run'
component: iot-software-sensor
- name: debug
actions:
- workdir: '${CHE_PROJECTS_ROOT}/manuela-dev/components/iot-software-sensor'
type: exec
command: >-
mvn -Duser.home=${HOME} spring-boot:run -Drun.jvmArguments="-Xdebug
-Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000"
component: iot-software-sensor
- name: test
actions:
- workdir: '${CHE_PROJECTS_ROOT}/manuela-dev/components/iot-software-sensor'
type: exec
command: 'MAVEN_OPTS="-Xmx200m" && mvn -Duser.home=${HOME} verify'
component: iot-software-sensor
- name: dependency-analysis
actions:
- workdir: '${CHE_PROJECTS_ROOT}/manuela-dev/components/iot-software-sensor'
type: exec
command: >-
${HOME}/stack-analysis.sh -f
${CHE_PROJECTS_ROOT}/manuela-dev/components/iot-software-sensor/pom.xml -p
${CHE_PROJECTS_ROOT}/manuela-dev/components/iot-software-sensor
component: iot-software-sensor
- name: install dependencies
actions:
- workdir: '${CHE_PROJECTS_ROOT}/manuela-dev/components/iot-consumer'
type: exec
command: npm install
component: iot-consumer
- name: start iot-consumer
actions:
- workdir: '${CHE_PROJECTS_ROOT}/manuela-dev/components/iot-consumer'
type: exec
command: nodemon index.js
component: iot-consumer
- name: stop iot-consumer
actions:
- type: exec
command: >-
node_server_pids=$(pgrep -fx '.*nodemon (--inspect )?index.js' | tr
"\\n" " ") && echo "Stopping node server with PIDs:
${node_server_pids}" && kill -15 ${node_server_pids} &>/dev/null &&
echo 'Done.'
component: iot-consumer
- name: install Ionic and dependencies
actions:
- workdir: '${CHE_PROJECTS_ROOT}/manuela-dev/components/iot-frontend'
type: exec
command: npm i -g ionic && npm install
component: iot-frontend
- name: start iot-frontend
actions:
- workdir: '${CHE_PROJECTS_ROOT}/manuela-dev/components/iot-frontend'
type: exec
command: npm run serve:dev
component: iot-frontend
- name: audit fix dependencies
actions:
- workdir: '${CHE_PROJECTS_ROOT}/manuela-dev/components/iot-frontend'
type: exec
command: npm audit fix
component: iot-frontend
- name: Update iot-consumer URL config
actions:
- workdir: '${CHE_PROJECTS_ROOT}/manuela-dev/components/iot-frontend/src/conf'
type: exec
command: >-
oc login --server=${KUBERNETES_SERVICE_HOST}:443 &&
export IOT_CONSUMER_ROUTE=$(oc get route | grep iot-consumer | awk '{ print $2 }') &&
sed -i 's|http://localhost:3000|https://'$IOT_CONSUMER_ROUTE'|' config.json
component: iot-frontend