Skip to content
This repository has been archived by the owner on Aug 16, 2024. It is now read-only.

Commit

Permalink
Add devfile with java sample based on google cloud sample (#135)
Browse files Browse the repository at this point in the history
* Add java-guestbook sample

Signed-off-by: svor <vsvydenk@redhat.com>
  • Loading branch information
svor authored and monaka committed Nov 25, 2019
1 parent 39fe2ba commit 8df84fa
Show file tree
Hide file tree
Showing 2 changed files with 127 additions and 0 deletions.
121 changes: 121 additions & 0 deletions devfiles/java-mongo/devfile.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
---
apiVersion: 1.0.0
metadata:
generateName: java-mongo-
projects:
-
name: java-guestbook
source:
type: git
location: "/~https://github.com/che-samples/java-guestbook.git"
components:
-
type: chePlugin
id: redhat/java/latest
memoryLimit: 1280MiB
-
type: dockerimage
alias: maven
image: quay.io/eclipse/che-java8-maven:nightly
env:
- name: JAVA_OPTS
value: "-XX:MaxRAMPercentage=50.0 -XX:+UseParallelGC -XX:MinHeapFreeRatio=10
-XX:MaxHeapFreeRatio=20 -XX:GCTimeRatio=4 -XX:AdaptiveSizePolicyWeight=90
-Dsun.zip.disableMemoryMapping=true -Xms20m -Djava.security.egd=file:/dev/./urandom
-Duser.home=/home/user"
- name: MAVEN_OPTS
value: $(JAVA_OPTS)
memoryLimit: 512Mi
mountSources: true
endpoints:
- name: java-guestbook-backend
attributes:
discoverable: 'true'
public: 'false'
port: 8080
- name: java-guestbook
attributes:
discoverable: 'true'
public: 'true'
port: 8443
volumes:
- name: m2
containerPath: /home/user/.m2
-
type: dockerimage
alias: mongo
image: centos/mongodb-34-centos7
env:
- name: MONGODB_USER
value: user
- name: MONGODB_PASSWORD
value: password
- name: MONGODB_DATABASE
value: guestbook
- name: MONGODB_ADMIN_PASSWORD
value: password
memoryLimit: 300Mi
endpoints:
- name: java-guestbook-mongodb
attributes:
discoverable: 'true'
public: 'false'
port: 27017
commands:
-
name: maven build backend
actions:
-
type: exec
component: maven
command: "mvn clean install"
workdir: "${CHE_PROJECTS_ROOT}/java-guestbook/backend"
-
name: maven build frontend
actions:
- type: exec
component: maven
command: "mvn clean install"
workdir: "${CHE_PROJECTS_ROOT}/java-guestbook/frontend"
-
name: run backend
actions:
-
type: exec
component: maven
command: |
java -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5006,quiet=y \
-jar target/backend-1.0.jar
workdir: "${CHE_PROJECTS_ROOT}/java-guestbook/backend"
-
name: run frontend
actions:
- type: exec
component: maven
command: |
java -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005,quiet=y \
-jar target/frontend-1.0.jar
workdir: "${CHE_PROJECTS_ROOT}/java-guestbook/frontend"
-
name: Debug remote
actions:
- type: vscode-launch
referenceContent: |
{
"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
}]
}
6 changes: 6 additions & 0 deletions devfiles/java-mongo/meta.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
displayName: Java with Spring Boot and MongoDB
description: Java stack with OpenJDK 8, MongoDB and Spring Boot Guestbook demo application
tags: ["Java", "OpenJDK", "Maven", "Spring Boot", "MongoDB"]
icon: https://www.eclipse.org/che/images/logo-eclipseche.svg
globalMemoryLimit: 2884Mi

0 comments on commit 8df84fa

Please sign in to comment.