Skip to content

Instantly share code, notes, and snippets.

@luszczynski
Last active May 5, 2021 19:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save luszczynski/c409a0cd9e2206c0cb723f259851d27e to your computer and use it in GitHub Desktop.
Save luszczynski/c409a0cd9e2206c0cb723f259851d27e to your computer and use it in GitHub Desktop.
Dev file for Quarkus
apiVersion: 1.0.0
metadata:
generateName: quarkus-
projects:
- name: quarkus-quickstarts
source:
type: zip
location: 'https://devfile-registry-openshift-workspaces.apps.cluster-a183.a183.sandbox1868.opentlc.com/resources/quarkus-quarkus-quickstarts-main.zip'
components:
- type: chePlugin
id: redhat/quarkus-java11/latest
- type: chePlugin
id: redhat/dependency-analytics/latest
- id: redhat/vscode-openshift-connector/latest
type: chePlugin
alias: vscode-openshift
- type: dockerimage
alias: mysql
image: quay.io/eclipse/che--centos--mysql-57-centos7:latest-e08ee4d43b7356607685b69bde6335e27cf20c020f345b6c6c59400183882764
env:
- name: MYSQL_USER
value: petclinic
- name: MYSQL_PASSWORD
value: petclinic
- name: MYSQL_DATABASE
value: petclinic
- name: PS1
value: $(echo ${0})\\$
memoryLimit: 300Mi
endpoints:
- name: 'db'
port: 3306
attributes:
discoverable: "true"
public: "false"
mountSources: true
- type: dockerimage
alias: maven
image: 'registry.redhat.io/codeready-workspaces/plugin-java11-rhel8@sha256:d93195134cef6351b1f9e3165fecc09f464dc99ab33d11b68fadd613d04d1636'
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/jboss'
- name: MAVEN_OPTS
value: $(JAVA_OPTS)
memoryLimit: 512Mi
mountSources: true
volumes:
- name: m2
containerPath: /home/jboss/.m2
endpoints:
- name: quarkus-development-server
port: 8080
- attributes:
path: /hello/greeting/che-user
name: hello-greeting-endpoint
port: 8080
- attributes:
public: 'false'
name: debug
port: 5005
- attributes:
public: 'false'
name: tests
port: 8081
commands:
- name: 1. Package the application
actions:
- type: exec
component: maven
command: mvn package
workdir: '${CHE_PROJECTS_ROOT}/quarkus-quickstarts/getting-started'
- name: 2. Start Quarkus in devmode (hot deploy + debug)
actions:
- type: exec
component: maven
command: 'mvn compile quarkus:dev -Dquarkus.http.host=0.0.0.0 -Dquarkus.live-reload.instrumentation=false'
workdir: '${CHE_PROJECTS_ROOT}/quarkus-quickstarts/getting-started'
- name: build NATIVE quarkus-backend
actions:
- type: exec
command: "pkill java; mvn package -Dnative -Dmaven.test.skip -Dquarkus.native.native-image-xmx=2G"
component: maven
workdir: '${CHE_PROJECTS_ROOT}/quarkus-quickstarts/getting-started'
- name: oc login
actions:
- type: exec
command: |-
rm oc; curl https://mirror.openshift.com/pub/openshift-v4/clients/oc/latest/linux/oc.tar.gz -s | tar zxv && ./oc login --server=${KUBERNETES_SERVICE_HOST}:443
component: vscode-openshift
workdir: /tmp
- name: Attach remote debugger
actions:
- type: vscode-launch
referenceContent: |
{
"version": "0.2.0",
"configurations": [
{
"type": "java",
"request": "attach",
"name": "Attach to Remote Quarkus App",
"hostName": "localhost",
"port": 5005
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment