forked from che-samples/web-nodejs-sample
-
Notifications
You must be signed in to change notification settings - Fork 0
/
devfile.yaml
55 lines (51 loc) · 1.36 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
schemaVersion: 2.1.0
metadata:
name: nodejs-web-app
components:
- name: tools
container:
image: quay.io/devfile/universal-developer-image:ubi8-0e189d9
endpoints:
- exposure: public
name: nodejs
protocol: http
targetPort: 3000
memoryLimit: 1G
mountSources: true
commands:
- id: install-dependencies
exec:
label: "Install dependencies"
component: tools
workingDir: ${PROJECT_SOURCE}/app
commandLine: "npm install"
group:
kind: build
isDefault: true
- id: run-application
exec:
label: "Run web application"
component: tools
workingDir: ${PROJECT_SOURCE}/app
commandLine: "nodemon app.js"
group:
kind: run
- id: debug
exec:
label: "Run web application (debugging enabled)"
component: tools
workingDir: ${PROJECT_SOURCE}/app
commandLine: "nodemon --inspect app.js"
group:
kind: debug
isDefault: true
- id: stop-application
exec:
label: "Stop web application"
component: tools
commandLine: >-
node_server_pids=$(pgrep -fx '.*nodemon (--inspect )?app.js' | tr "\\n" " ") &&
echo "Stopping node server with PIDs: ${node_server_pids}" &&
kill -15 ${node_server_pids} &>/dev/null && echo 'Done.'
group:
kind: run