Skip to content

Commit

Permalink
Introduce Devfile V2 (#1)
Browse files Browse the repository at this point in the history
* chore(devfile2): introduce devfile V2 to be working in devworkspaces

Signed-off-by: Vitaliy Gulyy <vgulyy@redhat.com>
  • Loading branch information
vitaliy-guliy authored Nov 3, 2021
1 parent 22b2d31 commit b156150
Show file tree
Hide file tree
Showing 4 changed files with 134 additions and 1 deletion.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
.idea/compiler.xml
.idea/encodings.xml
.idea/vcs.xml
.vscode
**/*.iml
target
*.iml
Expand Down
19 changes: 19 additions & 0 deletions .theia/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"version": "0.2.0",
"configurations": [
{
"type": "java",
"name": "Debug (Attach) - Backend",
"request": "attach",
"hostName": "localhost",
"port": 5006
},
{
"type": "java",
"name": "Debug (Attach) - Frontend",
"request": "attach",
"hostName": "localhost",
"port": 5005
}
]
}
7 changes: 7 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
// See https://go.microsoft.com/fwlink/?LinkId=827846
// for the documentation about the extensions.json format
"recommendations": [
"redhat.java"
]
}
108 changes: 108 additions & 0 deletions devfile.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
schemaVersion: 2.1.0
metadata:
name: java-guestbook
components:
- name: tools
container:
image: quay.io/devfile/universal-developer-image:ubi8-d433ed6
memoryLimit: 3Gi

endpoints:
- name: java-guestbook-backend
exposure: public
protocol: http
targetPort: 8080

- name: java-guestbook
exposure: public
protocol: tcp
targetPort: 8443

- name: debug
exposure: none
protocol: tcp
targetPort: 5005

volumeMounts:
- name: m2
path: /home/user/.m2

- name: mongo
container:
image: quay.io/eclipse/che--centos--mongodb-36-centos7:latest-ffdf2431bbc6d9a9d2a03e95bbbe8adb49ab9eac301f268a35038c84288259c1
memoryLimit: 300Mi
env:
- name: MONGODB_USER
value: user

- name: MONGODB_PASSWORD
value: password

- name: MONGODB_DATABASE
value: guestbook

- name: MONGODB_ADMIN_PASSWORD
value: password

endpoints:
- name: java-guestbook-mongodb
exposure: none
protocol: tcp
targetPort: 27017

volumeMounts:
- name: mongodbdata
path: /var/lib/mongodb/data

- name: m2
volume:
size: 1G

- name: mongodbdata
volume:
size: 1G

commands:
- id: maven-build-backend
exec:
label: "build backend"
component: tools
workingDir: "${PROJECTS_ROOT}/java-guestbook/backend"
commandLine: "mvn clean install"
group:
kind: build
isDefault: true

- id: maven-build-frontend
exec:
label: "build frontend"
component: tools
workingDir: "${PROJECTS_ROOT}/java-guestbook/frontend"
commandLine: "mvn clean install"
group:
kind: build
isDefault: true

- id: run-backend
exec:
label: "run backend"
component: tools
workingDir: "${PROJECTS_ROOT}/java-guestbook/backend"
commandLine: |
java -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5006,quiet=y \
-jar target/backend-1.0.jar
group:
kind: run
isDefault: true

- id: run-frontend
exec:
label: "run frontend"
component: tools
workingDir: "${PROJECTS_ROOT}/java-guestbook/frontend"
commandLine: |
java -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005,quiet=y \
-jar target/frontend-1.0.jar
group:
kind: run
isDefault: true

0 comments on commit b156150

Please sign in to comment.