schemaVersion: 2.1.0 metadata: name: test-pull-request starterProjects: - git: checkoutFrom: revision: main remotes: origin: https://github.com/devfile-samples/devfile-stack-nodejs-nextjs.git name: nodejs-nextjs-starter components: - name: tools container: image: registry.access.redhat.com/ubi9/ubi:9.5 args: ['tail', '-f', '/dev/null'] endpoints: - exposure: public name: nodejs protocol: http targetPort: 3000 memoryLimit: 2Gi memoryRequest: 256Mi mountSources: true env: - name: VSCODE_TRUSTED_EXTENSIONS value: "GitHub.copilot,GitHub.copilot-chat" attributes: controller.devfile.io/merge-contribution: true commands: - id: install-dependencies exec: label: "Install dependencies" component: tools workingDir: ${PROJECT_SOURCE}/app commandLine: "npm install" group: kind: build isDefault: true - id: test-namespace-env-var exec: label: "Test namespace" component: tools workingDir: ${PROJECT_SOURCE}/app commandLine: "echo $DEVWORKSPACE_NAMESPACE" - 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