Skip to content

Instantly share code, notes, and snippets.

@rhopp
Created May 4, 2021 08:19
Show Gist options
  • Save rhopp/0e8453df3753e9099355caaf3277b395 to your computer and use it in GitHub Desktop.
Save rhopp/0e8453df3753e9099355caaf3277b395 to your computer and use it in GitHub Desktop.
apiVersion: 1.0.0
metadata:
name: java-eap-maven-eyeln
projects:
- name: kitchensink-example
source:
location: 'https://github.com/jboss-developer/jboss-eap-quickstarts.git'
type: git
sparseCheckoutDir: kitchensink-jsp
branch: 7.4.x
components:
- id: redhat/java11/latest
type: chePlugin
- id: redhat/dependency-analytics/latest
type: chePlugin
- mountSources: true
endpoints:
- attributes:
path: /index.jsp
name: eap
port: 8080
- attributes:
public: 'false'
name: jgroups
port: 7600
memoryLimit: 1024Mi
type: dockerimage
volumes:
- name: m2
containerPath: /home/jboss/.m2/repository
alias: maven
image: registry.redhat.io/jboss-eap-7-tech-preview/eap74-openjdk11-openshift-rhel8
env:
- value: '-Xmx200m -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: '-Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=n -Dsun.util.logging.disableCallerCheck=true'
name: JAVA_OPTS_APPEND
- value: '-Dmaven.repo.local=/home/jboss/.m2/repository/repository -Dcom.redhat.xpaas.repo.jbossorg'
name: MVN_ARGS_APPEND
commands:
- name: 1. Build
actions:
- workdir: '${CHE_PROJECTS_ROOT}/kitchensink-example/kitchensink-jsp'
type: exec
command: 'mvn ${MVN_ARGS_APPEND} clean install'
component: maven
- name: 2. Configure web server
actions:
- workdir: /opt/eap/bin
type: exec
command: './jboss-cli.sh --connect --command="data-source add --name=ExampleDS --jndi-name=java:jboss/datasources/ExampleDS --driver-name=h2 --connection-url=jdbc:h2:mem:test;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=FALSE --user-name=sa --password=sa" && echo ''Server was configured'''
component: maven
- name: 3. Copy war
actions:
- workdir: '${CHE_PROJECTS_ROOT}/kitchensink-example/kitchensink-jsp'
type: exec
command: 'cp target/*.war /opt/eap/standalone/deployments/ROOT.war && echo ''Archive was deployed, click on eap endpoint from Workspace view to open the application'''
component: maven
- name: 4. Hot update
actions:
- workdir: '${CHE_PROJECTS_ROOT}/kitchensink-example/kitchensink-jsp'
type: exec
command: 'mvn ${MVN_ARGS_APPEND} clean install && sleep 2 && cp target/*.war /opt/eap/standalone/deployments/ROOT.war'
component: maven
- name: Debug (Attach)
actions:
- referenceContent: |
{
"version": "0.2.0",
"configurations": [
{
"type": "java",
"request": "attach",
"name": "Debug (Attach)",
"hostName": "localhost",
"port": 8000
}
]
}
type: vscode-launch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment