-
Notifications
You must be signed in to change notification settings - Fork 75
Expand file tree
/
Copy pathnodejs-stack.devfile.yaml
More file actions
48 lines (48 loc) · 1.26 KB
/
nodejs-stack.devfile.yaml
File metadata and controls
48 lines (48 loc) · 1.26 KB
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
schemaVersion: 2.0.0
metadata:
name: nodejs-stack
projects:
- name: project
git:
remotes:
origin: "https://github.com/che-samples/web-nodejs-sample.git"
components:
- name: nodejs
container:
image: quay.io/eclipse/che-nodejs10-ubi:nightly
memoryLimit: 512Mi
endpoints:
- name: nodejs
protocol: http
targetPort: 3000
mountSources: true
commands:
- id: download-dependencies
exec:
component: nodejs
commandLine: npm install
workingDir: ${PROJECTS_ROOT}/project/app
group:
kind: build
- id: run-the-app
exec:
component: nodejs
commandLine: nodemon app.js
workingDir: ${PROJECTS_ROOT}/project/app
group:
kind: run
isDefault: true
- id: run-the-app-debugging-enabled
exec:
component: nodejs
commandLine: nodemon --inspect app.js
workingDir: ${PROJECTS_ROOT}/project/app
group:
kind: run
- id: stop-the-app
exec:
component: nodejs
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.'