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

Commit

Permalink
Add Java Web devfiles (#18)
Browse files Browse the repository at this point in the history
This commits contains devfile for:
* Java Spring Boot
* Java with Spring Boot and MySQL
* Java Vert.x

Signed-off-by: Sergii Leshchenko <sleshche@redhat.com>
  • Loading branch information
sleshchenko authored Jul 16, 2019
1 parent 73967c0 commit 93bcd2e
Show file tree
Hide file tree
Showing 6 changed files with 203 additions and 0 deletions.
76 changes: 76 additions & 0 deletions devfiles/java-mysql/devfile.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
---
apiVersion: 1.0.0
metadata:
name: java-mysql
projects:
-
name: web-java-spring-petclinic
source:
type: git
location: "/~https://github.com/spring-projects/spring-petclinic.git"
components:
-
type: chePlugin
id: redhat/java/latest
-
type: dockerimage
alias: tools
image: registry.centos.org/che-stacks/centos-jdk8
command: ['sleep']
args: ['infinity']
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)
- name: PS1
value: $(echo ${0})\\$
memoryLimit: 700Mi
endpoints:
- name: '8080/tcp'
port: 8080
mountSources: true
volumes:
- name: m2
containerPath: /home/user/.m2
-
type: dockerimage
alias: mysql
image: centos/mysql-57-centos7
env:
- name: MYSQL_USER
value: petclinic
- name: MYSQL_PASSWORD
value: password
- name: MYSQL_DATABASE
value: petclinic
- name: PS1
value: $(echo ${0})\\$
memoryLimit: 256Mi
endpoints:
- name: 'db'
port: 3306
attributes:
discoverable: "true"
public: "false"
mountSources: false
commands:
-
name: maven build
actions:
-
type: exec
component: tools
command: "./mvnw clean install"
workdir: "${CHE_PROJECTS_ROOT}/web-java-spring-petclinic"
- name: run webapp
actions:
-
type: exec
component: tools
command: |
SPRING_DATASOURCE_URL=jdbc:mysql://db/petclinic SPRING_DATASOURCE_USERNAME=petclinic SPRING_DATASOURCE_PASSWORD=password java -jar target/*.jar --spring.profile.active=mysql
workdir: ${CHE_PROJECTS_ROOT}/web-java-spring-petclinic
6 changes: 6 additions & 0 deletions devfiles/java-mysql/meta.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
displayName: Java with Spring Boot and MySQL
description: Java stack with OpenJDK 8, MySQL and Spring Boot Petclinic demo application
tags: ["Java", "OpenJDK", "Maven", "Spring Boot", "MySQL"]
icon: https://www.eclipse.org/che/images/logo-eclipseche.svg
globalMemoryLimit: 2930Mi
54 changes: 54 additions & 0 deletions devfiles/java-web-spring/devfile.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
---
apiVersion: 1.0.0
metadata:
name: java-web-spring
projects:
-
name: java-web-spring
source:
type: git
location: "/~https://github.com/spring-projects/spring-petclinic.git"
components:
-
type: chePlugin
id: redhat/java/latest
-
type: dockerimage
alias: tools
image: registry.centos.org/che-stacks/centos-jdk8
command: ['sleep']
args: ['infinity']
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)
- name: PS1
value: $(echo ${0})\\$
memoryLimit: 1024Mi
endpoints:
- name: '8080/tcp'
port: 8080
mountSources: true
volumes:
- name: m2
containerPath: /home/user/.m2
commands:
-
name: maven build
actions:
-
type: exec
component: tools
command: "./mvnw clean install"
workdir: ${CHE_PROJECTS_ROOT}/java-web-spring
- name: run webapp
actions:
-
type: exec
component: tools
command: "java -jar target/*.jar"
workdir: ${CHE_PROJECTS_ROOT}/java-web-spring
6 changes: 6 additions & 0 deletions devfiles/java-web-spring/meta.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
displayName: Java Spring Boot
description: Java stack with OpenJDK 8 and Spring Boot Petclinic demo application
tags: ["Java", "OpenJDK", "Maven", "Spring Boot"]
icon: https://www.eclipse.org/che/images/logo-eclipseche.svg
globalMemoryLimit: 2674Mi
55 changes: 55 additions & 0 deletions devfiles/java-web-vertx/devfile.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
---
apiVersion: 1.0.0
metadata:
name: java-web-vertx
projects:
-
name: java-web-vertx
source:
type: git
location: "/~https://github.com/che-samples/web-java-vertx"
components:
-
type: chePlugin
id: redhat/java/latest
-
type: dockerimage
alias: maven
image: registry.centos.org/che-stacks/centos-jdk8
command: ['sleep']
args: ['infinity']
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)
- name: PS1
value: $(echo ${0})\\$
memoryLimit: 512Mi
endpoints:
- name: '8080/tcp'
port: 8080
mountSources: true
volumes:
- name: m2
containerPath: /home/user/.m2
commands:
-
name: maven build
actions:
-
type: exec
component: maven
command: "mvn -Duser.home=${HOME} clean install"
workdir: "${CHE_PROJECTS_ROOT}/java-web-vertx"
-
name: run app
actions:
-
type: exec
component: maven
command: "JDBC_URL=jdbc:h2:/tmp/db java -jar ./target/*fat.jar"
workdir: "${CHE_PROJECTS_ROOT}/java-web-vertx"
6 changes: 6 additions & 0 deletions devfiles/java-web-vertx/meta.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
displayName: Java Vert.x
description: Java stack with OpenJDK 8 and Vert.x demo application
tags: ["Java", "OpenJDK", "Maven", "Vertx"]
icon: https://www.eclipse.org/che/images/logo-eclipseche.svg
globalMemoryLimit: 2674Mi

0 comments on commit 93bcd2e

Please sign in to comment.