Skip to content

Instantly share code, notes, and snippets.

@AndrienkoAleksandr
Last active November 25, 2019 08:44
Show Gist options
  • Save AndrienkoAleksandr/d2873ffbacc948503b5e6f9e26663b92 to your computer and use it in GitHub Desktop.
Save AndrienkoAleksandr/d2873ffbacc948503b5e6f9e26663b92 to your computer and use it in GitHub Desktop.
metadata:
name: webview
projects:
- name: nodejs-web-app
source:
location: 'https://github.com/che-samples/web-nodejs-sample.git'
type: git
branch: master
attributes:
persistVolumes: 'false'
components:
- id: che-incubator/typescript/latest
memoryLimit: 512Mi
type: chePlugin
- mountSources: true
endpoints:
- name: nodejs
port: 3000
memoryLimit: 512Mi
type: dockerimage
alias: nodejs
image: 'quay.io/eclipse/che-nodejs10-ubi:nightly'
- memoryLimit: 712Mi
type: cheEditor
reference: >-
https://gist.githubusercontent.com/AndrienkoAleksandr/dae3c16d2bed5fef61c8ca0c7b012151/raw/fb34187353da697bdc2fd3abff2ba55b8ffda3f5/meta.yaml-webview2
apiVersion: 1.0.0
commands:
- name: run the web app (debugging enabled)
actions:
- workdir: '${CHE_PROJECTS_ROOT}/nodejs-web-app/app'
type: exec
command: nodemon --inspect app.js
component: nodejs
- name: download dependencies
actions:
- workdir: '${CHE_PROJECTS_ROOT}/nodejs-web-app/app'
type: exec
command: npm install
component: nodejs
- name: run the web app
actions:
- workdir: '${CHE_PROJECTS_ROOT}/nodejs-web-app/app'
type: exec
command: nodemon app.js
component: nodejs
- name: stop the web app
actions:
- type: exec
command: >-
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.'
component: nodejs
- name: Attach remote debugger
actions:
- referenceContent: |
{
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "attach",
"name": "Attach to Remote",
"address": "localhost",
"port": 9229,
"localRoot": "${workspaceFolder}",
"remoteRoot": "${workspaceFolder}"
}
]
}
type: vscode-launch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment