Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Node devfile tests #3459

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions docs/public/debugging-using-devfile.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ metadata:
name: test-devfile
projects:
-
name: nodejs-web-app
name: nodejs-starter
source:
type: git
location: "https://github.com/che-samples/web-nodejs-sample.git"
Expand All @@ -32,19 +32,19 @@ commands:
- type: exec
component: runtime
command: "npm install"
workdir: ${CHE_PROJECTS_ROOT}/nodejs-web-app/app
workdir: ${CHE_PROJECTS_ROOT}/nodejs-starter/app
- name: devrun
actions:
- type: exec
component: runtime
command: "nodemon app.js"
workdir: ${CHE_PROJECTS_ROOT}/nodejs-web-app/app
workdir: ${CHE_PROJECTS_ROOT}/nodejs-starter/app
- name: debugrun
actions:
- type: exec
component: runtime
command: "nodemon --inspect=${DEBUG_PORT}"
workdir: ${CHE_PROJECTS_ROOT}/nodejs-web-app/
workdir: ${CHE_PROJECTS_ROOT}/nodejs-starter/
```

- Now we need to create the component using `odo create nodejs`
Expand Down
4 changes: 2 additions & 2 deletions pkg/odo/cli/component/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -136,8 +136,8 @@ Note: When you use odo with experimental mode enabled and create devfile compone
# Create new Node.js component with custom ports, additional environment variables and memory and cpu limits
%[1]s nodejs --port 8080,8100/tcp,9100/udp --env key=value,key1=value1 --memory 4Gi --cpu 2

# Create new Node.js component and download the sample project named nodejs-web-app
%[1]s nodejs --downloadSource=nodejs-web-app`)
# Create new Node.js component and download the sample project named nodejs-starter
%[1]s nodejs --downloadSource=nodejs-starter`)

const defaultProjectName = "devfile-project-name"

Expand Down
14 changes: 7 additions & 7 deletions tests/examples/source/devfiles/nodejs/devfile-no-endpoints.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,29 +2,29 @@ schemaVersion: 2.0.0
metadata:
name: test-devfile
projects:
- name: nodejs-web-app
- name: nodejs-starter
git:
location: "https://github.com/che-samples/web-nodejs-sample.git"
location: "https://github.com/odo-devfiles/nodejs-ex.git"
components:
- container:
name: runtime
image: quay.io/eclipse/che-nodejs10-ubi:nightly
image: registry.access.redhat.com/ubi8/nodejs-12:1-36
memoryLimit: 1024Mi
mountSources: true
commands:
- exec:
id: devbuild
component: runtime
commandLine: "npm install"
workingDir: ${CHE_PROJECTS_ROOT}/nodejs-web-app/app
commandLine: npm install
workingDir: ${CHE_PROJECTS_ROOT}/nodejs-starter
group:
kind: build
isDefault: true
- exec:
id: devrun
component: runtime
commandLine: "nodemon app.js"
workingDir: ${CHE_PROJECTS_ROOT}/nodejs-web-app/app
commandLine: npm start
workingDir: ${CHE_PROJECTS_ROOT}/nodejs-starter
group:
kind: run
isDefault: true
18 changes: 9 additions & 9 deletions tests/examples/source/devfiles/nodejs/devfile-with-debugrun.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ schemaVersion: 2.0.0
metadata:
name: test-devfile
projects:
- name: nodejs-web-app
- name: nodejs-starter
git:
location: "https://github.com/che-samples/web-nodejs-sample.git"
location: "https://github.com/odo-devfiles/nodejs-ex.git"
components:
- container:
name: runtime
image: quay.io/eclipse/che-nodejs10-ubi:nightly
image: registry.access.redhat.com/ubi8/nodejs-12:1-36
memoryLimit: 1024Mi
endpoints:
- name: "3000/tcp"
Expand All @@ -21,24 +21,24 @@ commands:
- exec:
id: devbuild
component: runtime
commandLine: "npm install"
workingDir: ${CHE_PROJECTS_ROOT}/nodejs-web-app/app
commandLine: npm install
workingDir: ${CHE_PROJECTS_ROOT}/nodejs-starter
group:
kind: build
isDefault: true
- exec:
id: devrun
component: runtime
commandLine: "nodemon app.js"
workingDir: ${CHE_PROJECTS_ROOT}/nodejs-web-app/app
commandLine: npm start
workingDir: ${CHE_PROJECTS_ROOT}/nodejs-starter
group:
kind: run
isDefault: true
- exec:
id: debugrun
component: runtime
commandLine: "nodemon --inspect=${DEBUG_PORT}"
workingDir: ${CHE_PROJECTS_ROOT}/nodejs-web-app/
commandLine: npm run debug
workingDir: ${CHE_PROJECTS_ROOT}/nodejs-starter
group:
kind: debug
isDefault: true
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ schemaVersion: 2.0.0
metadata:
name: test-devfile
projects:
- name: nodejs-web-app
- name: nodejs-starter
git:
location: "https://github.com/che-samples/web-nodejs-sample.git"
location: "https://github.com/odo-devfiles/nodejs-ex.git"
components:
- container:
name: runtime
image: quay.io/eclipse/che-nodejs10-ubi:nightly
image: registry.access.redhat.com/ubi8/nodejs-12:1-36
memoryLimit: 1024Mi
endpoints:
- name: "3000/tcp"
Expand All @@ -21,35 +21,35 @@ commands:
- exec:
id: firstbuild
component: runtime
commandLine: "npm install"
workingDir: ${CHE_PROJECTS_ROOT}/nodejs-web-app/app
commandLine: npm install
workingDir: ${CHE_PROJECTS_ROOT}/nodejs-starter
group:
kind: build
isDefault: true
- exec:
id: secondbuild
component: runtime
commandLine: "npm install"
workingDir: ${CHE_PROJECTS_ROOT}/nodejs-web-app/app
commandLine: npm install
workingDir: ${CHE_PROJECTS_ROOT}/nodejs-starter
group:
kind: build
isDefault: true
- exec:
id: thirdbuild
component: runtime
commandLine: "npm install"
workingDir: ${CHE_PROJECTS_ROOT}/nodejs-web-app/app
commandLine: npm install
workingDir: ${CHE_PROJECTS_ROOT}/nodejs-starter
- exec:
id: firstrun
component: runtime
commandLine: "nodemon app.js"
workingDir: ${CHE_PROJECTS_ROOT}/nodejs-web-app/app
commandLine: npm start
workingDir: ${CHE_PROJECTS_ROOT}/nodejs-starter
group:
kind: run
- exec:
id: secondrun
component: runtime
commandLine: "nodemon app.js"
workingDir: ${CHE_PROJECTS_ROOT}/nodejs-web-app/app
commandLine: npm start
workingDir: ${CHE_PROJECTS_ROOT}/nodejs-starter
group:
kind: run
14 changes: 7 additions & 7 deletions tests/examples/source/devfiles/nodejs/devfile-with-restart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,21 @@ schemaVersion: 2.0.0
metadata:
name: test-devfile
projects:
- name: nodejs-web-app
- name: nodejs-starter
git:
location: "https://github.com/che-samples/web-nodejs-sample.git"
location: "https://github.com/odo-devfiles/nodejs-ex.git"
components:
- container:
name: runtime
image: quay.io/eclipse/che-nodejs10-ubi:nightly
image: registry.access.redhat.com/ubi8/nodejs-12:1-36
memoryLimit: 1024Mi
mountSources: true
commands:
- exec:
id: devbuild
component: runtime
commandLine: "npm install"
workingDir: ${CHE_PROJECTS_ROOT}/nodejs-web-app/app
commandLine: npm install
workingDir: ${CHE_PROJECTS_ROOT}/nodejs-starter
group:
kind: build
isDefault: true
Expand All @@ -25,8 +25,8 @@ commands:
attributes:
restart: "false"
component: runtime
commandLine: "nodemon app.js"
workingDir: ${CHE_PROJECTS_ROOT}/nodejs-web-app/app
commandLine: npm start
workingDir: ${CHE_PROJECTS_ROOT}/nodejs-starter
group:
kind: run
isDefault: true
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@ metadata:
name: test-devfile
projects:
-
name: nodejs-web-app
name: nodejs-starter
source:
type: git
location: "https://github.com/che-samples/web-nodejs-sample.git"
sparseCheckoutDir: /app/
components:
- type: dockerimage
image: quay.io/eclipse/che-nodejs10-ubi:nightly
image: registry.access.redhat.com/ubi8/nodejs-12:1-36
endpoints:
- name: "3000/tcp"
port: 3000
Expand All @@ -25,23 +25,23 @@ commands:
actions:
- type: exec
component: runtime
command: "npm install"
workdir: ${CHE_PROJECTS_ROOT}/nodejs-web-app/app
command: npm install
workdir: ${CHE_PROJECTS_ROOT}/nodejs-starter
- name: devbuild
actions:
- type: exec
component: runtime
command: "npm install"
workdir: ${CHE_PROJECTS_ROOT}/nodejs-web-app/app
command: npm install
workdir: ${CHE_PROJECTS_ROOT}/nodejs-starter
- name: run
actions:
- type: exec
component: runtime
command: "nodemon app.js"
workdir: ${CHE_PROJECTS_ROOT}/nodejs-web-app/app
command: npm start
workdir: ${CHE_PROJECTS_ROOT}/nodejs-starter
- name: devrun
actions:
- type: exec
component: runtime
command: "nodemon app.js"
workdir: ${CHE_PROJECTS_ROOT}/nodejs-web-app/app
command: npm start
workdir: ${CHE_PROJECTS_ROOT}/nodejs-starter
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ schemaVersion: 2.0.0
metadata:
name: test-devfile
projects:
- name: nodejs-web-app
- name: nodejs-starter
git:
location: "https://github.com/che-samples/web-nodejs-sample.git"
components:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ schemaVersion: 2.0.0
metadata:
name: test-devfile
projects:
- name: nodejs-web-app
- name: nodejs-starter
git:
location: "https://github.com/che-samples/web-nodejs-sample.git"
location: "https://github.com/odo-devfiles/nodejs-ex.git"
components:
- container:
name: runtime
image: quay.io/eclipse/che-nodejs10-ubi:nightly
image: registry.access.redhat.com/ubi8/nodejs-12:1-36
memoryLimit: 1024Mi
env:
- name: FOO
Expand All @@ -24,8 +24,8 @@ commands:
- exec:
id: devrun
component: runtime
commandLine: "npm install && nodemon app.js"
workingDir: ${CHE_PROJECTS_ROOT}/nodejs-web-app/app
commandLine: "npm install && npm start"
workingDir: ${CHE_PROJECTS_ROOT}/nodejs-starter
group:
kind: run
isDefault: true
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ schemaVersion: 2.0.0
metadata:
name: test-devfile
projects:
- name: nodejs-web-app
- name: nodejs-starter
git:
location: "https://github.com/che-samples/web-nodejs-sample.git"
location: "https://github.com/odo-devfiles/nodejs-ex.git"
components:
- container:
name: runtime
Expand All @@ -24,16 +24,16 @@ commands:
- exec:
id: devbuild
component: runtime
commandLine: "npm install"
workingDir: ${CHE_PROJECTS_ROOT}/nodejs-web-app/app
commandLine: npm install
workingDir: ${CHE_PROJECTS_ROOT}/nodejs-starter
group:
kind: build
isDefault: true
- exec:
id: devrun
component: runtime
commandLine: "nodemon app.js"
workingDir: ${CHE_PROJECTS_ROOT}/nodejs-web-app/app
commandLine: npm start
workingDir: ${CHE_PROJECTS_ROOT}/nodejs-starter
group:
kind: run
isDefault: true
Loading