diff --git a/.gitignore b/.gitignore index b3745cc..39bb1ca 100644 --- a/.gitignore +++ b/.gitignore @@ -9,7 +9,6 @@ .idea/compiler.xml .idea/encodings.xml .idea/vcs.xml -.vscode **/*.iml target *.iml diff --git a/.theia/launch.json b/.theia/launch.json new file mode 100644 index 0000000..33ec8fe --- /dev/null +++ b/.theia/launch.json @@ -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 + } + ] +} diff --git a/.vscode/extensions.json b/.vscode/extensions.json new file mode 100644 index 0000000..6e372dc --- /dev/null +++ b/.vscode/extensions.json @@ -0,0 +1,7 @@ +{ + // See https://go.microsoft.com/fwlink/?LinkId=827846 + // for the documentation about the extensions.json format + "recommendations": [ + "redhat.java" + ] +} diff --git a/devfile.yaml b/devfile.yaml new file mode 100644 index 0000000..5f114ba --- /dev/null +++ b/devfile.yaml @@ -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