mirror of
				https://github.com/redhat-developer/odo.git
				synced 2025-10-19 03:06:19 +03:00 
			
		
		
		
	Converts v1 devfiles to v2 (#3279)
* Converts v1 devfiles to v2 * Moves init tests to devfilesV1 folder
This commit is contained in:
		| @@ -1,28 +1,30 @@ | |||||||
| apiVersion: 1.0.0 | schemaVersion: 2.0.0 | ||||||
| metadata: | metadata: | ||||||
|   name: test-devfile |   name: test-devfile | ||||||
| projects: | projects: | ||||||
|   - |   - name: nodejs-web-app | ||||||
|     name: nodejs-web-app |     git: | ||||||
|     source: |  | ||||||
|       type: git |  | ||||||
|       location: "https://github.com/che-samples/web-nodejs-sample.git" |       location: "https://github.com/che-samples/web-nodejs-sample.git" | ||||||
| components: | components: | ||||||
|   - type: dockerimage |   - container: | ||||||
|     image: quay.io/eclipse/che-nodejs10-ubi:nightly |       name: runtime | ||||||
|     alias: runtime |       image: quay.io/eclipse/che-nodejs10-ubi:nightly | ||||||
|     memoryLimit: 1024Mi |       memoryLimit: 1024Mi | ||||||
|     mountSources: true |       mountSources: true | ||||||
| commands: | commands: | ||||||
|   - name: devbuild |   - exec: | ||||||
|     actions: |       id: devbuild | ||||||
|       - type: exec |       component: runtime | ||||||
|         component: runtime |       commandLine: "npm install" | ||||||
|         command: "npm install" |       workingDir: ${CHE_PROJECTS_ROOT}/nodejs-web-app/app | ||||||
|         workdir: ${CHE_PROJECTS_ROOT}/nodejs-web-app/app |       group: | ||||||
|   - name: devrun |         kind: build | ||||||
|     actions: |         isDefault: true | ||||||
|       - type: exec |   - exec: | ||||||
|         component: runtime |       id: devrun | ||||||
|         command: "nodemon app.js" |       component: runtime | ||||||
|         workdir: ${CHE_PROJECTS_ROOT}/nodejs-web-app/app |       commandLine: "nodemon app.js" | ||||||
|  |       workingDir: ${CHE_PROJECTS_ROOT}/nodejs-web-app/app | ||||||
|  |       group: | ||||||
|  |         kind: run | ||||||
|  |         isDefault: true | ||||||
| @@ -1,30 +1,32 @@ | |||||||
| apiVersion: 1.0.0 | schemaVersion: 2.0.0 | ||||||
| metadata: | metadata: | ||||||
|   name: test-devfile |   name: test-devfile | ||||||
| projects: | projects: | ||||||
|   - |   - name: nodejs-web-app | ||||||
|     name: nodejs-web-app |     git: | ||||||
|     source: |  | ||||||
|       type: git |  | ||||||
|       location: "https://github.com/che-samples/web-nodejs-sample.git" |       location: "https://github.com/che-samples/web-nodejs-sample.git" | ||||||
| components: | components: | ||||||
|   - type: dockerimage |   - container: | ||||||
|     image: quay.io/eclipse/che-nodejs10-ubi:nightly |       name: runtime | ||||||
|     alias: runtime |       image: quay.io/eclipse/che-nodejs10-ubi:nightly | ||||||
|     memoryLimit: 1024Mi |       memoryLimit: 1024Mi | ||||||
|     mountSources: true |       mountSources: true | ||||||
| commands: | commands: | ||||||
|   - name: devbuild |   - exec: | ||||||
|     actions: |       id: devbuild | ||||||
|       - type: exec |       component: runtime | ||||||
|         component: runtime |       commandLine: "npm install" | ||||||
|         command: "npm install" |       workingDir: ${CHE_PROJECTS_ROOT}/nodejs-web-app/app | ||||||
|         workdir: ${CHE_PROJECTS_ROOT}/nodejs-web-app/app |       group: | ||||||
|   - name: devrun |         kind: build | ||||||
|     attributes: |         isDefault: true | ||||||
|  |   - exec: | ||||||
|  |       id: devrun | ||||||
|  |       attributes: | ||||||
|         restart: "false" |         restart: "false" | ||||||
|     actions: |       component: runtime | ||||||
|       - type: exec |       commandLine: "nodemon app.js" | ||||||
|         component: runtime |       workingDir: ${CHE_PROJECTS_ROOT}/nodejs-web-app/app | ||||||
|         command: "nodemon app.js" |       group: | ||||||
|         workdir: ${CHE_PROJECTS_ROOT}/nodejs-web-app/app |         kind: run | ||||||
|  |         isDefault: true | ||||||
| @@ -1,53 +1,52 @@ | |||||||
| apiVersion: 1.0.0 | schemaVersion: 2.0.0 | ||||||
| metadata: | metadata: | ||||||
|   name: test-devfile |   name: test-devfile | ||||||
| projects: | projects: | ||||||
|   - |   - name: nodejs-web-app | ||||||
|     name: nodejs-web-app |     git: | ||||||
|     source: |  | ||||||
|       type: git |  | ||||||
|       location: "https://github.com/che-samples/web-nodejs-sample.git" |       location: "https://github.com/che-samples/web-nodejs-sample.git" | ||||||
| components: | components: | ||||||
|   - type: dockerimage |   - container: | ||||||
|     image: quay.io/eclipse/che-nodejs10-ubi:nightly |       name: runtime | ||||||
|     endpoints: |       image: quay.io/eclipse/che-nodejs10-ubi:nightly | ||||||
|       - name: "3000/tcp" |       memoryLimit: 1024Mi | ||||||
|         port: 3000 |       env: | ||||||
|     alias: runtime |         - name: FOO | ||||||
|     env: |           value: "bar" | ||||||
|       - name: FOO |       endpoints: | ||||||
|         value: "bar" |         - name: "3000/tcp" | ||||||
|     memoryLimit: 1024Mi |           configuration: | ||||||
|     mountSources: true |             protocol: tcp | ||||||
|     volumes: |             scheme: http | ||||||
|       - name: myvol |           targetPort: 3000 | ||||||
|         containerPath: /data |       mountSources: true | ||||||
|   - type: dockerimage |       volumeMounts: | ||||||
|     image: quay.io/eclipse/che-nodejs10-ubi:nightly |         - name: myvol | ||||||
|     alias: runtime2 |           path: /data | ||||||
|     memoryLimit: 1024Mi |   - container: | ||||||
|     mountSources: false |       name: runtime2 | ||||||
|     volumes: |       image: quay.io/eclipse/che-nodejs10-ubi:nightly | ||||||
|       - name: myvol |       memoryLimit: 1024Mi | ||||||
|         containerPath: /data |       mountSources: false | ||||||
|       - name: myvol2 |       volumeMounts: | ||||||
|         containerPath: /data2 |         - name: myvol | ||||||
|  |           path: /data | ||||||
|  |         - name: myvol2 | ||||||
|  |           path: /data2 | ||||||
| commands: | commands: | ||||||
|   - name: devInit |   - exec: | ||||||
|     actions: |       id: devbuild | ||||||
|       - type: exec |       component: runtime | ||||||
|         component: runtime |       commandLine: "echo hello >> myfile.log" | ||||||
|         command: "echo init >> myfile-init.log" |       workingDir: /data | ||||||
|         workdir: /data |       group: | ||||||
|   - name: devBuild |         kind: build | ||||||
|     actions: |         isDefault: true | ||||||
|       - type: exec |   - exec: | ||||||
|         component: runtime |       id: devrun | ||||||
|         command: "echo hello >> myfile.log" |       component: runtime2 | ||||||
|         workdir: /data |       commandLine: "cat myfile.log" | ||||||
|   - name: devRun |       workingDir: /data | ||||||
|     actions: |       group: | ||||||
|       - type: exec |         kind: run | ||||||
|         component: runtime2 |         isDefault: true | ||||||
|         command: "cat myfile.log" |  | ||||||
|         workdir: /data |  | ||||||
| @@ -1,28 +1,31 @@ | |||||||
| apiVersion: 1.0.0 | schemaVersion: 2.0.0 | ||||||
| metadata: | metadata: | ||||||
|   name: test-devfile |   name: test-devfile | ||||||
| projects: | projects: | ||||||
|   - |   - name: nodejs-web-app | ||||||
|     name: nodejs-web-app |     git: | ||||||
|     source: |  | ||||||
|       type: git |  | ||||||
|       location: "https://github.com/che-samples/web-nodejs-sample.git" |       location: "https://github.com/che-samples/web-nodejs-sample.git" | ||||||
| components: | components: | ||||||
|   - type: dockerimage |   - container: | ||||||
|     image: quay.io/eclipse/che-nodejs10-ubi:nightly |       name: runtime | ||||||
|     endpoints: |       image: quay.io/eclipse/che-nodejs10-ubi:nightly | ||||||
|       - name: "3000/tcp" |       memoryLimit: 1024Mi | ||||||
|         port: 3000 |       env: | ||||||
|     alias: runtime |         - name: FOO | ||||||
|     env: |           value: "bar" | ||||||
|       - name: FOO |       endpoints: | ||||||
|         value: "bar" |         - name: "3000/tcp" | ||||||
|     memoryLimit: 1024Mi |           configuration: | ||||||
|     mountSources: true |             protocol: tcp | ||||||
|  |             scheme: http | ||||||
|  |           targetPort: 3000 | ||||||
|  |       mountSources: true | ||||||
| commands: | commands: | ||||||
|   - name: devrun |   - exec: | ||||||
|     actions: |       id: devrun | ||||||
|       - type: exec |       component: runtime | ||||||
|         component: runtime |       commandLine: "npm install && nodemon app.js" | ||||||
|         command: "npm install && nodemon app.js" |       workingDir: ${CHE_PROJECTS_ROOT}/nodejs-web-app/app | ||||||
|         workdir: ${CHE_PROJECTS_ROOT}/nodejs-web-app/app |       group: | ||||||
|  |         kind: run | ||||||
|  |         isDefault: true | ||||||
| @@ -1,34 +1,39 @@ | |||||||
| apiVersion: 1.0.0 | schemaVersion: 2.0.0 | ||||||
| metadata: | metadata: | ||||||
|   name: test-devfile |   name: test-devfile | ||||||
| projects: | projects: | ||||||
|   - |   - name: nodejs-web-app | ||||||
|     name: nodejs-web-app |     git: | ||||||
|     source: |  | ||||||
|       type: git |  | ||||||
|       location: "https://github.com/che-samples/web-nodejs-sample.git" |       location: "https://github.com/che-samples/web-nodejs-sample.git" | ||||||
| components: | components: | ||||||
|   - type: dockerimage |   - container: | ||||||
|     image: quay.io/eclipse/che-nodejs10-ubi:nightly |       name: runtime | ||||||
|     endpoints: |       image: quay.io/eclipse/che-nodejs10-ubi:nightly | ||||||
|       - name: "3000/tcp" |       memoryLimit: 1024Mi | ||||||
|         port: 3000 |       env: | ||||||
|     alias: runtime |         - name: FOO | ||||||
|     env: |           value: "bar" | ||||||
|       - name: FOO |       endpoints: | ||||||
|         value: "bar" |         - name: "3000/tcp" | ||||||
|     memoryLimit: 1024Mi |           configuration: | ||||||
|     mountSources: true |             protocol: tcp | ||||||
|  |             scheme: http | ||||||
|  |           targetPort: 3000 | ||||||
|  |       mountSources: true | ||||||
| commands: | commands: | ||||||
|   - name: devbuild |   - exec: | ||||||
|     actions: |       id: devbuild | ||||||
|       - type: exec |       component: runtime | ||||||
|         component: runtime |       commandLine: "npm install" | ||||||
|         command: "npm install" |       workingDir: ${CHE_PROJECTS_ROOT}/nodejs-web-app/app | ||||||
|         workdir: ${CHE_PROJECTS_ROOT}/nodejs-web-app/app |       group: | ||||||
|   - name: devrun |         kind: build | ||||||
|     actions: |         isDefault: true | ||||||
|       - type: exec |   - exec: | ||||||
|         component: runtime |       id: devrun | ||||||
|         command: "nodemon app.js" |       component: runtime | ||||||
|         workdir: ${CHE_PROJECTS_ROOT}/nodejs-web-app/app |       commandLine: "nodemon app.js" | ||||||
|  |       workingDir: ${CHE_PROJECTS_ROOT}/nodejs-web-app/app | ||||||
|  |       group: | ||||||
|  |         kind: run | ||||||
|  |         isDefault: true | ||||||
| @@ -1,46 +1,50 @@ | |||||||
| apiVersion: 1.0.0 | schemaVersion: 2.0.0 | ||||||
| metadata: | metadata: | ||||||
|   name: test-devfile |   name: test-devfile | ||||||
| projects: | projects: | ||||||
|   - |   - name: nodejs-web-app | ||||||
|     name: nodejs-web-app |     git: | ||||||
|     source: |  | ||||||
|       type: git |  | ||||||
|       location: "https://github.com/che-samples/web-nodejs-sample.git" |       location: "https://github.com/che-samples/web-nodejs-sample.git" | ||||||
| components: | components: | ||||||
|   - type: dockerimage |   - container: | ||||||
|     image: quay.io/eclipse/che-nodejs10-ubi:nightly |       name: runtime | ||||||
|     endpoints: |       image: quay.io/eclipse/che-nodejs10-ubi:nightly | ||||||
|       - name: "3000/tcp" |       memoryLimit: 1024Mi | ||||||
|         port: 3000 |       endpoints: | ||||||
|     alias: runtime |         - name: "3000/tcp" | ||||||
|     env: |           configuration: | ||||||
|       - name: FOO |             protocol: tcp | ||||||
|         value: "bar" |             scheme: http | ||||||
|     memoryLimit: 1024Mi |           targetPort: 3000 | ||||||
|     mountSources: true |       mountSources: true | ||||||
| commands: | commands: | ||||||
|   - name: build |   - exec: | ||||||
|     actions: |       id: devbuild | ||||||
|       - type: exec |       component: runtime | ||||||
|         component: runtime |       commandLine: "npm install" | ||||||
|         command: "npm install" |       workingDir: ${CHE_PROJECTS_ROOT}/nodejs-web-app/app | ||||||
|         workdir: ${CHE_PROJECTS_ROOT}/nodejs-web-app/app |       group: | ||||||
|   - name: devbuild |         kind: build | ||||||
|     actions: |         isDefault: true | ||||||
|       - type: exec |   - exec: | ||||||
|         component: runtime |       id: build | ||||||
|         command: "npm install" |       component: runtime | ||||||
|         workdir: ${CHE_PROJECTS_ROOT}/nodejs-web-app/app |       commandLine: "npm install" | ||||||
|   - name: run |       workingDir: ${CHE_PROJECTS_ROOT}/nodejs-web-app/app | ||||||
|     actions: |       group: | ||||||
|       - type: exec |         kind: build | ||||||
|         component: runtime |   - exec: | ||||||
|         command: "nodemon app.js" |       id: devrun | ||||||
|         workdir: ${CHE_PROJECTS_ROOT}/nodejs-web-app/app |       component: runtime | ||||||
|   - name: devrun |       commandLine: "nodemon app.js" | ||||||
|     actions: |       workingDir: ${CHE_PROJECTS_ROOT}/nodejs-web-app/app | ||||||
|       - type: exec |       group: | ||||||
|         component: runtime |         kind: run | ||||||
|         command: "nodemon app.js" |         isDefault: true | ||||||
|         workdir: ${CHE_PROJECTS_ROOT}/nodejs-web-app/app |   - exec: | ||||||
|  |       id: run | ||||||
|  |       component: runtime | ||||||
|  |       commandLine: "nodemon app.js" | ||||||
|  |       workingDir: ${CHE_PROJECTS_ROOT}/nodejs-web-app/app | ||||||
|  |       group: | ||||||
|  |         kind: run | ||||||
| @@ -1,55 +1,52 @@ | |||||||
| --- | --- | ||||||
| apiVersion: 1.0.0 | schemaVersion: 2.0.0 | ||||||
| metadata: | metadata: | ||||||
|   generateName: java-spring-boot |   name: java-spring-boot | ||||||
| projects: | projects: | ||||||
|   - |   - name: springbootproject | ||||||
|     name: springbootproject |     git: | ||||||
|     source: |  | ||||||
|       type: git |  | ||||||
|       location: "https://github.com/maysunfaisal/springboot.git" |       location: "https://github.com/maysunfaisal/springboot.git" | ||||||
| components: | components: | ||||||
|   - |   - container: | ||||||
|     type: chePlugin |       name: tools | ||||||
|     id: redhat/java/latest |       image: maysunfaisal/springbootbuild | ||||||
|     memoryLimit: 1512Mi |       memoryLimit: 768Mi | ||||||
|   - |       command: ['tail'] | ||||||
|     type: dockerimage |       args: [ '-f', '/dev/null'] | ||||||
|     image: maysunfaisal/springbootbuild |       volumeMounts: | ||||||
|     alias: tools |         - name: springbootpvc | ||||||
|     memoryLimit: 768Mi |           path: /data | ||||||
|     command: ['tail'] |       mountSources: true | ||||||
|     args: [ '-f', '/dev/null'] |   - container: | ||||||
|     mountSources: true |       name: runtime | ||||||
|     volumes: |       image: maysunfaisal/springbootruntime | ||||||
|       - name: springbootpvc |       memoryLimit: 768Mi | ||||||
|         containerPath: /data |       command: ['tail'] | ||||||
|   - |       args: [ '-f', '/dev/null'] | ||||||
|     type: dockerimage |       endpoints: | ||||||
|     image: maysunfaisal/springbootruntime |         - name: "8080/tcp" | ||||||
|     alias: runtime |           configuration: | ||||||
|     memoryLimit: 768Mi |             protocol: tcp | ||||||
|     endpoints: |             scheme: http | ||||||
|       - name: '8080/tcp' |           targetPort: 8080 | ||||||
|         port: 8080 |       volumeMounts: | ||||||
|     mountSources: false |         - name: springbootpvc | ||||||
|     volumes: |           path: /data | ||||||
|       - name: springbootpvc |       mountSources: false | ||||||
|         containerPath: /data |  | ||||||
| commands: | commands: | ||||||
|   - |   - exec: | ||||||
|     name: devBuild |       id: devbuild | ||||||
|     actions: |       component: tools | ||||||
|       - |       commandLine: "/artifacts/bin/build-container-full.sh" | ||||||
|         type: exec |       workingDir: /projects/springbootproject | ||||||
|         component: tools |       group: | ||||||
|         command: "/artifacts/bin/build-container-full.sh" |         kind: build | ||||||
|         workdir: /projects/springbootproject |         isDefault: true | ||||||
|   - |   - exec: | ||||||
|     name: devRun |       id: devrun | ||||||
|     actions: |       component: runtime | ||||||
|       - |       commandLine: "/artifacts/bin/start-server.sh" | ||||||
|         type: exec |       workingDir: / | ||||||
|         component: runtime |       group: | ||||||
|         command: "/artifacts/bin/start-server.sh" |         kind: run | ||||||
|         workdir: / |         isDefault: true | ||||||
| @@ -3,18 +3,15 @@ apiVersion: 1.0.0 | |||||||
| metadata: | metadata: | ||||||
|   generateName: java-spring-boot |   generateName: java-spring-boot | ||||||
| projects: | projects: | ||||||
|   - |   - name: springbootproject | ||||||
|     name: springbootproject |  | ||||||
|     source: |     source: | ||||||
|       type: git |       type: git | ||||||
|       location: "https://github.com/maysunfaisal/springboot.git" |       location: "https://github.com/maysunfaisal/springboot.git" | ||||||
| components: | components: | ||||||
|   - |   - type: chePlugin | ||||||
|     type: chePlugin |  | ||||||
|     id: redhat/java/latest |     id: redhat/java/latest | ||||||
|     memoryLimit: 1512Mi |     memoryLimit: 1512Mi | ||||||
|   - |   - type: dockerimage | ||||||
|     type: dockerimage |  | ||||||
|     image: maysunfaisal/springbootbuild |     image: maysunfaisal/springbootbuild | ||||||
|     alias: tools |     alias: tools | ||||||
|     memoryLimit: 768Mi |     memoryLimit: 768Mi | ||||||
| @@ -24,8 +21,7 @@ components: | |||||||
|     volumes: |     volumes: | ||||||
|       - name: springbootpvc |       - name: springbootpvc | ||||||
|         containerPath: /data |         containerPath: /data | ||||||
|   - |   - type: dockerimage | ||||||
|     type: dockerimage |  | ||||||
|     image: maysunfaisal/springbootruntime |     image: maysunfaisal/springbootruntime | ||||||
|     alias: runtime |     alias: runtime | ||||||
|     memoryLimit: 768Mi |     memoryLimit: 768Mi | ||||||
| @@ -37,19 +33,15 @@ components: | |||||||
|       - name: springbootpvc |       - name: springbootpvc | ||||||
|         containerPath: /data |         containerPath: /data | ||||||
| commands: | commands: | ||||||
|   -  |   - name: devInit | ||||||
|     name: devInit |  | ||||||
|     actions: |     actions: | ||||||
|       -  |       - type: exec | ||||||
|         type: exec |  | ||||||
|         component: tools |         component: tools | ||||||
|         command: "echo hello; touch /data/afile.txt" |         command: "echo hello; touch /data/afile.txt" | ||||||
|         workdir: /projects/springbootproject |         workdir: /projects/springbootproject | ||||||
|   - |   - name: devRun | ||||||
|     name: devRun |  | ||||||
|     actions: |     actions: | ||||||
|       - |       - type: exec | ||||||
|         type: exec |  | ||||||
|         component: runtime |         component: runtime | ||||||
|         command: "/artifacts/bin/start-server.sh" |         command: "/artifacts/bin/start-server.sh" | ||||||
|         workdir: / |         workdir: / | ||||||
| @@ -37,10 +37,10 @@ components: | |||||||
|       - name: springbootpvc |       - name: springbootpvc | ||||||
|         containerPath: /data |         containerPath: /data | ||||||
| commands: | commands: | ||||||
|   -  |   - | ||||||
|     name: devinit |     name: devinit | ||||||
|     actions: |     actions: | ||||||
|       -  |       - | ||||||
|         type: exec |         type: exec | ||||||
|         component: tools |         component: tools | ||||||
|         command: "echo hello" |         command: "echo hello" | ||||||
| @@ -60,4 +60,4 @@ commands: | |||||||
|         type: exec |         type: exec | ||||||
|         component: runtime |         component: runtime | ||||||
|         command: "/artifacts/bin/start-server.sh" |         command: "/artifacts/bin/start-server.sh" | ||||||
|         workdir: / |         workdir: / | ||||||
| @@ -1,39 +0,0 @@ | |||||||
| schemaVersion: "2.0.0" |  | ||||||
| metadata: |  | ||||||
|   name: test-devfile |  | ||||||
| projects: |  | ||||||
|   - name: nodejs-web-app |  | ||||||
|     git:  |  | ||||||
|       location: "https://github.com/che-samples/web-nodejs-sample.git" |  | ||||||
| components: |  | ||||||
|   - container: |  | ||||||
|       image: quay.io/eclipse/che-nodejs10-ubi:nightly |  | ||||||
|       mountSources: true |  | ||||||
|       name: "runtime" |  | ||||||
|       memoryLimit: 1024Mi |  | ||||||
|       env: |  | ||||||
|       - name: FOO |  | ||||||
|         value: "bar" |  | ||||||
|       endpoints: |  | ||||||
|         - name: '3000/tcp' |  | ||||||
|           targetPort: 3000 |  | ||||||
|           # odo not using currently, added to validate JSON Schema |  | ||||||
|           configuration: |  | ||||||
|             protocol: tcp |  | ||||||
|             scheme: http |  | ||||||
|             type: terminal |  | ||||||
| commands: |  | ||||||
|   - exec: |  | ||||||
|       id: download dependencies |  | ||||||
|       commandLine: "npm install" |  | ||||||
|       component: runtime |  | ||||||
|       workingDir: ${CHE_PROJECTS_ROOT}/nodejs-web-app/app |  | ||||||
|       group: |  | ||||||
|         kind: build |  | ||||||
|   - exec: |  | ||||||
|       id: run the app |  | ||||||
|       commandLine: "nodemon app.js" |  | ||||||
|       component: runtime |  | ||||||
|       workingDir: ${CHE_PROJECTS_ROOT}/nodejs-web-app/app  |  | ||||||
|       group: |  | ||||||
|         kind: run                               |  | ||||||
| @@ -1,56 +0,0 @@ | |||||||
| schemaVersion: 2.0.0 |  | ||||||
| metadata: |  | ||||||
|   name: java-spring-boot |  | ||||||
|   version: 1.0.0 |  | ||||||
| projects: |  | ||||||
|   - name: springbootproject |  | ||||||
|     git: |  | ||||||
|       location: "https://github.com/odo-devfiles/springboot-ex.git" |  | ||||||
| components: |  | ||||||
|   - chePlugin: |  | ||||||
|       id: redhat/java/latest |  | ||||||
|       memoryLimit: 1512Mi |  | ||||||
|   - container: |  | ||||||
|       name: tools |  | ||||||
|       image: maysunfaisal/springbootbuild |  | ||||||
|       memoryLimit: 768Mi |  | ||||||
|       command: ['tail'] |  | ||||||
|       args: [ '-f', '/dev/null'] |  | ||||||
|       mountSources: true |  | ||||||
|       volumeMounts: |  | ||||||
|         - name: springbootpvc |  | ||||||
|           path: /data |  | ||||||
|   - container: |  | ||||||
|       name: runtime |  | ||||||
|       image: maysunfaisal/springbootruntime |  | ||||||
|       memoryLimit: 768Mi |  | ||||||
|       command: ['tail'] |  | ||||||
|       args: [ '-f', '/dev/null'] |  | ||||||
|       endpoints: |  | ||||||
|         - name: '8080/tcp' |  | ||||||
|           targetPort: 8080 |  | ||||||
|           configuration: |  | ||||||
|             discoverable: false |  | ||||||
|             public: true |  | ||||||
|             protocol: http |  | ||||||
|       mountSources: false |  | ||||||
|       volumeMounts: |  | ||||||
|         - name: springbootpvc |  | ||||||
|           path: /data |  | ||||||
| commands: |  | ||||||
|   - exec: |  | ||||||
|       id: devBuild |  | ||||||
|       component: tools |  | ||||||
|       commandLine: "/artifacts/bin/build-container-full.sh" |  | ||||||
|       workingDir: /projects/springbootproject |  | ||||||
|       group: |  | ||||||
|         kind: build |  | ||||||
|         isDefault: true |  | ||||||
|   - exec: |  | ||||||
|       id: devRun |  | ||||||
|       component: runtime |  | ||||||
|       commandLine: "/artifacts/bin/start-server.sh" |  | ||||||
|       workingDir: / |  | ||||||
|       group: |  | ||||||
|         kind: run |  | ||||||
|         isDefault: true |  | ||||||
| @@ -107,7 +107,7 @@ func ReplaceString(filename string, oldString string, newString string) { | |||||||
| 	f, err := ioutil.ReadFile(filename) | 	f, err := ioutil.ReadFile(filename) | ||||||
| 	Expect(err).NotTo(HaveOccurred()) | 	Expect(err).NotTo(HaveOccurred()) | ||||||
|  |  | ||||||
| 	newContent := strings.Replace(string(f), oldString, newString, 1) | 	newContent := strings.ReplaceAll(string(f), oldString, newString) | ||||||
|  |  | ||||||
| 	err = ioutil.WriteFile(filename, []byte(newContent), 0600) | 	err = ioutil.WriteFile(filename, []byte(newContent), 0600) | ||||||
| 	Expect(err).NotTo(HaveOccurred()) | 	Expect(err).NotTo(HaveOccurred()) | ||||||
|   | |||||||
| @@ -191,7 +191,7 @@ var _ = Describe("odo devfile push command tests", func() { | |||||||
| 			helper.CmdShouldPass("odo", "create", "java-spring-boot", "--project", namespace, cmpName) | 			helper.CmdShouldPass("odo", "create", "java-spring-boot", "--project", namespace, cmpName) | ||||||
|  |  | ||||||
| 			helper.CopyExample(filepath.Join("source", "devfiles", "springboot", "project"), context) | 			helper.CopyExample(filepath.Join("source", "devfiles", "springboot", "project"), context) | ||||||
| 			helper.CopyExampleDevFile(filepath.Join("source", "devfiles", "springboot", "devfile-init.yaml"), filepath.Join(context, "devfile.yaml")) | 			helper.CopyExampleDevFile(filepath.Join("source", "devfilesV1", "springboot", "devfile-init.yaml"), filepath.Join(context, "devfile.yaml")) | ||||||
|  |  | ||||||
| 			output := helper.CmdShouldPass("odo", "push", "--namespace", namespace) | 			output := helper.CmdShouldPass("odo", "push", "--namespace", namespace) | ||||||
| 			helper.MatchAllInOutput(output, []string{ | 			helper.MatchAllInOutput(output, []string{ | ||||||
| @@ -205,7 +205,7 @@ var _ = Describe("odo devfile push command tests", func() { | |||||||
| 			helper.CmdShouldPass("odo", "create", "java-spring-boot", "--project", namespace, cmpName) | 			helper.CmdShouldPass("odo", "create", "java-spring-boot", "--project", namespace, cmpName) | ||||||
|  |  | ||||||
| 			helper.CopyExample(filepath.Join("source", "devfiles", "springboot", "project"), context) | 			helper.CopyExample(filepath.Join("source", "devfiles", "springboot", "project"), context) | ||||||
| 			helper.CopyExampleDevFile(filepath.Join("source", "devfiles", "springboot", "devfile-init-without-build.yaml"), filepath.Join(context, "devfile.yaml")) | 			helper.CopyExampleDevFile(filepath.Join("source", "devfilesV1", "springboot", "devfile-init-without-build.yaml"), filepath.Join(context, "devfile.yaml")) | ||||||
|  |  | ||||||
| 			output := helper.CmdShouldPass("odo", "push", "--namespace", namespace) | 			output := helper.CmdShouldPass("odo", "push", "--namespace", namespace) | ||||||
| 			helper.MatchAllInOutput(output, []string{ | 			helper.MatchAllInOutput(output, []string{ | ||||||
| @@ -218,7 +218,7 @@ var _ = Describe("odo devfile push command tests", func() { | |||||||
| 			helper.CmdShouldPass("odo", "create", "java-spring-boot", "--project", namespace, cmpName) | 			helper.CmdShouldPass("odo", "create", "java-spring-boot", "--project", namespace, cmpName) | ||||||
|  |  | ||||||
| 			helper.CopyExample(filepath.Join("source", "devfiles", "springboot", "project"), context) | 			helper.CopyExample(filepath.Join("source", "devfiles", "springboot", "project"), context) | ||||||
| 			helper.CopyExampleDevFile(filepath.Join("source", "devfiles", "springboot", "devfile-init.yaml"), filepath.Join(context, "devfile.yaml")) | 			helper.CopyExampleDevFile(filepath.Join("source", "devfilesV1", "springboot", "devfile-init.yaml"), filepath.Join(context, "devfile.yaml")) | ||||||
|  |  | ||||||
| 			output := helper.CmdShouldPass("odo", "push", "--namespace", namespace) | 			output := helper.CmdShouldPass("odo", "push", "--namespace", namespace) | ||||||
| 			helper.MatchAllInOutput(output, []string{ | 			helper.MatchAllInOutput(output, []string{ | ||||||
| @@ -278,7 +278,6 @@ var _ = Describe("odo devfile push command tests", func() { | |||||||
|  |  | ||||||
| 			output := helper.CmdShouldPass("odo", "push", "--namespace", namespace) | 			output := helper.CmdShouldPass("odo", "push", "--namespace", namespace) | ||||||
| 			helper.MatchAllInOutput(output, []string{ | 			helper.MatchAllInOutput(output, []string{ | ||||||
| 				"Executing devinit command", |  | ||||||
| 				"Executing devbuild command", | 				"Executing devbuild command", | ||||||
| 				"Executing devrun command", | 				"Executing devrun command", | ||||||
| 			}) | 			}) | ||||||
| @@ -288,19 +287,6 @@ var _ = Describe("odo devfile push command tests", func() { | |||||||
|  |  | ||||||
| 			var statErr error | 			var statErr error | ||||||
| 			var cmdOutput string | 			var cmdOutput string | ||||||
| 			cliRunner.CheckCmdOpInRemoteDevfilePod( |  | ||||||
| 				podName, |  | ||||||
| 				"runtime", |  | ||||||
| 				namespace, |  | ||||||
| 				[]string{"cat", "/data/myfile-init.log"}, |  | ||||||
| 				func(cmdOp string, err error) bool { |  | ||||||
| 					cmdOutput = cmdOp |  | ||||||
| 					statErr = err |  | ||||||
| 					return true |  | ||||||
| 				}, |  | ||||||
| 			) |  | ||||||
| 			Expect(statErr).ToNot(HaveOccurred()) |  | ||||||
| 			Expect(cmdOutput).To(ContainSubstring("init")) |  | ||||||
|  |  | ||||||
| 			cliRunner.CheckCmdOpInRemoteDevfilePod( | 			cliRunner.CheckCmdOpInRemoteDevfilePod( | ||||||
| 				podName, | 				podName, | ||||||
|   | |||||||
| @@ -153,7 +153,7 @@ var _ = Describe("odo docker devfile push command tests", func() { | |||||||
| 			helper.CmdShouldPass("odo", "create", "java-spring-boot", cmpName) | 			helper.CmdShouldPass("odo", "create", "java-spring-boot", cmpName) | ||||||
|  |  | ||||||
| 			helper.CopyExample(filepath.Join("source", "devfiles", "springboot", "project"), context) | 			helper.CopyExample(filepath.Join("source", "devfiles", "springboot", "project"), context) | ||||||
| 			helper.CopyExampleDevFile(filepath.Join("source", "devfiles", "springboot", "devfile-init.yaml"), filepath.Join(context, "devfile.yaml")) | 			helper.CopyExampleDevFile(filepath.Join("source", "devfilesV1", "springboot", "devfile-init.yaml"), filepath.Join(context, "devfile.yaml")) | ||||||
|  |  | ||||||
| 			output := helper.CmdShouldPass("odo", "push") | 			output := helper.CmdShouldPass("odo", "push") | ||||||
| 			helper.MatchAllInOutput(output, []string{ | 			helper.MatchAllInOutput(output, []string{ | ||||||
| @@ -174,7 +174,7 @@ var _ = Describe("odo docker devfile push command tests", func() { | |||||||
| 			helper.CmdShouldPass("odo", "create", "java-spring-boot", cmpName) | 			helper.CmdShouldPass("odo", "create", "java-spring-boot", cmpName) | ||||||
|  |  | ||||||
| 			helper.CopyExample(filepath.Join("source", "devfiles", "springboot", "project"), context) | 			helper.CopyExample(filepath.Join("source", "devfiles", "springboot", "project"), context) | ||||||
| 			helper.CopyExampleDevFile(filepath.Join("source", "devfiles", "springboot", "devfile-init-without-build.yaml"), filepath.Join(context, "devfile.yaml")) | 			helper.CopyExampleDevFile(filepath.Join("source", "devfilesV1", "springboot", "devfile-init-without-build.yaml"), filepath.Join(context, "devfile.yaml")) | ||||||
|  |  | ||||||
| 			output := helper.CmdShouldPass("odo", "push") | 			output := helper.CmdShouldPass("odo", "push") | ||||||
| 			helper.MatchAllInOutput(output, []string{ | 			helper.MatchAllInOutput(output, []string{ | ||||||
|   | |||||||
| @@ -64,8 +64,8 @@ func ExecWithMissingRunCommand(projectDirPath, cmpName, namespace string) { | |||||||
| 	helper.CopyExample(filepath.Join("source", "devfiles", "nodejs", "project"), projectDirPath) | 	helper.CopyExample(filepath.Join("source", "devfiles", "nodejs", "project"), projectDirPath) | ||||||
| 	helper.CopyExampleDevFile(filepath.Join("source", "devfiles", "nodejs", "devfile.yaml"), filepath.Join(projectDirPath, "devfile.yaml")) | 	helper.CopyExampleDevFile(filepath.Join("source", "devfiles", "nodejs", "devfile.yaml"), filepath.Join(projectDirPath, "devfile.yaml")) | ||||||
|  |  | ||||||
| 	// Rename the devrun command | 	// Remove the run commands | ||||||
| 	helper.ReplaceString(filepath.Join(projectDirPath, "devfile.yaml"), "devrun", "randomcommand") | 	helper.ReplaceString(filepath.Join(projectDirPath, "devfile.yaml"), "kind: run", "kind: debug") | ||||||
|  |  | ||||||
| 	args = []string{"push"} | 	args = []string{"push"} | ||||||
| 	args = useProjectIfAvailable(args, namespace) | 	args = useProjectIfAvailable(args, namespace) | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Mrinal Das
					Mrinal Das