Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wildfly 2.0.1 #311

Merged
merged 2 commits into from
Mar 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions stacks/java-wildfly/2.0.1/Containerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
ARG IMAGE_VERSION=latest-jdk17

FROM quay.io/wildfly/wildfly-s2i:$IMAGE_VERSION AS builder

ENV MVN_ARGS_APPEND="-s /home/jboss/.m2/settings.xml -Dmaven.repo.local=/home/jboss/.m2/repository -Dcom.redhat.xpaas.repo.jbossorg"
ENV JAVA_OPTS="-Djava.security.egd=file:/dev/urandom"
ENV S2I_DESTINATION_DIR=/build

WORKDIR /build
RUN mkdir src
COPY --chown=jboss:root pom.xml .
COPY --chown=jboss:root src src
RUN mvn $MVN_ARGS_APPEND -Popenshift -Dmaven.test.skip=true clean package

FROM quay.io/wildfly/wildfly-runtime:$IMAGE_VERSION AS runtime

COPY --chown=jboss:root --from=builder /build/target/server $JBOSS_HOME
RUN chmod -R ug+rwX $JBOSS_HOME
EXPOSE 8080
70 changes: 70 additions & 0 deletions stacks/java-wildfly/2.0.1/deploy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
kind: Deployment
apiVersion: apps/v1
metadata:
name: '{{applicationName}}'
spec:
replicas: 1
selector:
matchLabels:
app: '{{applicationName}}'
template:
metadata:
labels:
app: '{{applicationName}}'
spec:
containers:
- name: '{{applicationName}}'
image: '{{imageName}}:{{imageVersion}}'
ports:
- name: http
containerPort: 8080
protocol: TCP
resources:
limits:
memory: "1024Mi"
cpu: "500m"
---
kind: Service
apiVersion: v1
metadata:
name: '{{applicationName}}-svc'
spec:
ports:
- name: http-8080
port: 8080
protocol: TCP
targetPort: 8080
selector:
app: '{{applicationName}}'
#apiVersion: networking.k8s.io/v1
#kind: Ingress
#metadata:
# name: '{{applicationName}}-ingress'
# labels: {}
# annotations: {}
#spec:
# rules:
# - host: tests.info
# http:
# paths:
# - path: /
# pathType: Prefix
# backend:
# service:
# name: '{{applicationName}}-svc'
# port:
# number: 8080
#---
#kind: Route
#apiVersion: route.openshift.io/v1
#metadata:
# name: '{{applicationName}}-route'
#spec:
# to:
# kind: Service
# name: '{{applicationName}}-svc'
# weight: 100
# port:
# targetPort: http-8080
# wildcardPolicy: None
#---
164 changes: 164 additions & 0 deletions stacks/java-wildfly/2.0.1/devfile.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,164 @@
schemaVersion: 2.2.0
metadata:
name: wildfly-start
version: 2.0.1
website: https://wildfly.org
displayName: WildFly Getting Started
description: Upstream WildFly Getting Started
icon: https://design.jboss.org/wildfly/logo/final/wildfly_logomark.svg
tags: ['Java', 'WildFly']
projectType: 'wildfly'
language: 'java'
variables:
imageRegistry: 'quay.io'
imageName: 'getting-started'
imageVersion: 'latest'
applicationName: 'start'
nodeName: 'getting-started'
starterProjects:
- name: getting-started
description: WildFly Getting Started
git:
checkoutFrom:
remote: wildfly-devfile-examples
revision: getting-started
remotes:
wildfly-devfile-examples: https://github.com/wildfly-extras/wildfly-devfile-examples.git
components:
- name: tools
container:
image: quay.io/devfile/universal-developer-image:ubi8-latest
memoryLimit: 1512Mi
mountSources: true
volumeMounts:
- name: m2
path: /home/user/.m2
env:
- name: JAVA_OPTS
value: '-Djava.security.egd=file:/dev/urandom -Djboss.host.name=localhost'
- name: DEBUG_PORT
value: '5005'
- name: NODE_NAME
value: '{{nodeName}}'
- name: IMAGE_REGISTRY
value: '{{imageRegistry}}'
- name: IMAGE
value: '{{imageName}}'
endpoints:
- name: debug
exposure: internal
protocol: tcp
targetPort: 5005
- name: 'http'
protocol: http
targetPort: 8080
exposure: public
- name: 'management'
targetPort: 9990
protocol: http
exposure: internal
- name: image-build
image:
dockerfile:
buildContext: .
rootRequired: false
uri: Containerfile
imageName: '{{imageName}}:{{imageVersion}}'
- name: kubernetes-deploy
kubernetes:
endpoints:
- name: http-8080
path: /
targetPort: 8080
uri: deploy.yaml
attributes:
deployment/container-port: 8080
deployment/cpuLimit: 100m
deployment/cpuRequest: 10m
deployment/memoryLimit: 300Mi
deployment/memoryRequest: 180Mi
deployment/replicas: 1
- name: m2
volume:
size: 3Gi
commands:
- id: package
exec:
label: "InnerLoop 01 - Build the application."
component: tools
commandLine: mvn clean verify
workingDir: ${PROJECT_SOURCE}
hotReloadCapable: true
group:
kind: build
isDefault: true
- id: run
exec:
label: "InnerLoop 02 - Run the application in dev mode."
component: tools
commandLine: mvn -Dwildfly.javaOpts="-Djboss.host.name=${NODE_NAME}" -Dmaven.test.skip=true clean package org.wildfly.plugins:wildfly-maven-plugin:dev
workingDir: ${PROJECT_SOURCE}
hotReloadCapable: true
group:
kind: run
isDefault: true
- id: debug
exec:
label: "InnerLoop 03 - Debug the application in dev mode."
component: tools
commandLine: mvn -Dwildfly.javaOpts="-Djboss.host.name=${NODE_NAME} -agentlib:jdwp=transport=dt_socket,address=*:5005,server=y,suspend=n" -Dmaven.test.skip=true clean package org.wildfly.plugins:wildfly-maven-plugin:dev
workingDir: ${PROJECT_SOURCE}
hotReloadCapable: true
group:
kind: debug
isDefault: true
- id: build-runtime-image
exec:
label: "OuterLoop 01 - Build Runtime Image."
component: tools
commandLine: "podman build -f Containerfile -t ${IMAGE_REGISTRY}/${IMAGE_REGISTRY_NAMESPACE}/${IMAGE} ."
workingDir: ${PROJECT_SOURCE}
group:
kind: build
isDefault: false
- id: push-image
exec:
label: "OuterLoop 02 - Push Image into image registry."
component: tools
workingDir: ${PROJECT_SOURCE}
commandLine: "podman tag ${IMAGE_REGISTRY}/${IMAGE_REGISTRY_NAMESPACE}/${IMAGE} ${IMAGE_REGISTRY}/${IMAGE_REGISTRY_NAMESPACE}/${IMAGE}:latest && podman login ${IMAGE_REGISTRY} -u ${IMAGE_REGISTRY_LOGIN} -p ${IMAGE_REGISTRY_PASSWORD} && podman push --tls-verify=false ${IMAGE_REGISTRY}/${IMAGE_REGISTRY_NAMESPACE}/${IMAGE}:latest"
group:
kind: build
isDefault: false
- id: deploy-image
exec:
label: "OuterLoop 03 - Deploy Image into the cloud."
component: tools
workingDir: ${PROJECT_SOURCE}
commandLine: "helm repo add wildfly https://docs.wildfly.org/wildfly-charts/ && helm install ${IMAGE} -f .charts/helm.yaml --set build.enabled=false --set image.name=${IMAGE_REGISTRY}/${IMAGE_REGISTRY_NAMESPACE}/${IMAGE} wildfly/wildfly"
group:
kind: run
isDefault: false
- id: undeploy-image
exec:
label: "OuterLoop 04 - Undeploy Image from the cloud."
component: tools
workingDir: ${PROJECT_SOURCE}
commandLine: "helm uninstall ${IMAGE}"
group:
kind: run
isDefault: false
- id: build-image
apply:
component: image-build
- id: deployk8s
apply:
component: kubernetes-deploy
- id: deploy
composite:
commands:
- build-image
- deployk8s
group:
kind: deploy
isDefault: true
1 change: 1 addition & 0 deletions stacks/java-wildfly/stack.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,6 @@ icon: https://design.jboss.org/wildfly/logo/final/wildfly_logomark.svg
versions:
- version: 1.1.0
- version: 2.0.0
- version: 2.0.1
default: true

Loading