Skip to content

Instantly share code, notes, and snippets.

@objectiser
Created October 31, 2019 14:08
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save objectiser/667615926a40d6cd8eb675859ddee1a1 to your computer and use it in GitHub Desktop.
Save objectiser/667615926a40d6cd8eb675859ddee1a1 to your computer and use it in GitHub Desktop.
---
apiVersion: 1.0.0
metadata:
name: web-java-spring-boot
attributes:
persistVolumes: 'false'
projects:
-
name: web-java-spring-boot
source:
type: git
location: "https://github.com/che-samples/web-java-spring-boot.git"
components:
-
type: chePlugin
id: redhat/java/latest
memoryLimit: 1400Mi
-
type: dockerimage
alias: tools
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
endpoints:
- name: '8080/tcp'
port: 8080
mountSources: true
volumes:
- name: m2
containerPath: /home/user/.m2
-
type: dockerimage
alias: tracing
image: jaegertracing/all-in-one:latest
env:
- name: MEMORY_MAX_TRACES
value: "5000"
- name: COLLECTOR_ZIPKIN_HTTP_PORT
value: "9411"
memoryLimit: 128Mi
endpoints:
- name: 'tracing-ui'
port: 16686
- name: 'collector-grpc'
port: 14250
attributes:
public: 'false'
- name: 'collector-http'
port: 14268
attributes:
public: 'false'
- name: 'collector-zipkin'
port: 9411
attributes:
public: 'false'
- name: 'agent-config'
port: 5778
attributes:
public: 'false'
- name: '6831/udp'
port: 6831
attributes:
public: 'false'
- name: '6832/udp'
port: 6832
attributes:
public: 'false'
volumes:
- name: tmp
containerPath: /tmp
commands:
-
name: maven build
actions:
-
type: exec
component: tools
command: "mvn clean install"
workdir: ${CHE_PROJECTS_ROOT}/web-java-spring-boot
- name: run webapp
actions:
-
type: exec
component: tools
command: "mvn spring-boot:run"
workdir: ${CHE_PROJECTS_ROOT}/web-java-spring-boot
- name: stop webapp
actions:
-
type: exec
component: tools
command: "echo 'Stopping the application...' && kill $(pidof java) && echo 'The application has been successfully stopped'"
- name: run webapp (debug mode)
actions:
-
type: exec
component: tools
command: |
java -jar -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5005 \
target/*.jar
workdir: ${CHE_PROJECTS_ROOT}/web-java-spring-boot
- name: Debug remote java application
actions:
- type: vscode-launch
referenceContent: |
{
"version": "0.2.0",
"configurations": [
{
"type": "java",
"name": "Debug (Attach) - Remote",
"request": "attach",
"hostName": "localhost",
"port": 5005
}]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment