This repository has been archived by the owner on Aug 16, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 114
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add devfile with java sample based on google cloud sample (#135)
* Add java-guestbook sample Signed-off-by: svor <vsvydenk@redhat.com>
- Loading branch information
Showing
2 changed files
with
127 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
}] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |