-
Notifications
You must be signed in to change notification settings - Fork 80
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[KOGITO-9729] SonataFlow builder image is not preserving resources pa…
…th (#1677) * [KOGITO-9729] SonataFlow builder image is not preserving resources path Signed-off-by: Davide Salerno <[email protected]> * [KOGITO-9729] Added shell test Signed-off-by: Davide Salerno <[email protected]> * Update modules/kogito-swf/common/scripts/added/build-app.sh Co-authored-by: Tristan Radisson <[email protected]> * [KOGITO-9729] Stopping containers into the same shell test Signed-off-by: Davide Salerno <[email protected]> --------- Signed-off-by: Davide Salerno <[email protected]> Co-authored-by: Tristan Radisson <[email protected]>
- Loading branch information
1 parent
9ad98ac
commit 5fac5e9
Showing
9 changed files
with
177 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
40 changes: 40 additions & 0 deletions
40
tests/shell/kogito-swf-builder/resources/greet-with-inputschema/Dockerfile
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
ARG BUILDER_IMAGE_TAG="quay.io/kiegroup/kogito-swf-builder:2.0" | ||
|
||
FROM ${BUILDER_IMAGE_TAG} AS builder | ||
|
||
# Kogito user | ||
USER 1001 | ||
|
||
ARG QUARKUS_PACKAGE_TYPE="jar" | ||
ARG SCRIPT_DEBUG="true" | ||
ARG MAVEN_DOWNLOAD_OUTPUT="true" | ||
ARG MAVEN_OFFLINE_MODE="true" | ||
|
||
# Copy from build context to resources directory | ||
COPY ./ ./resources/ | ||
|
||
# Build app with given resources | ||
RUN "${KOGITO_HOME}"/launch/build-app.sh './resources' | ||
|
||
#============================= | ||
# Runtime Run | ||
#============================= | ||
FROM registry.access.redhat.com/ubi8/openjdk-11-runtime:latest | ||
|
||
ARG QUARKUS_LAUNCH_DEVMODE=false | ||
|
||
ENV LANG='en_US.UTF-8' LANGUAGE='en_US:en' | ||
# Default name is 'serverless-workflow-project' | ||
ARG PROJECT_ARTIFACT_ID='serverless-workflow-project' | ||
|
||
# We make four distinct layers so if there are application changes the library layers can be re-used | ||
COPY --from=builder --chown=185 /home/kogito/${PROJECT_ARTIFACT_ID}/target/quarkus-app/lib/ /deployments/lib/ | ||
COPY --from=builder --chown=185 /home/kogito/${PROJECT_ARTIFACT_ID}/target/quarkus-app/*.jar /deployments/ | ||
COPY --from=builder --chown=185 /home/kogito/${PROJECT_ARTIFACT_ID}/target/quarkus-app/app/ /deployments/app/ | ||
COPY --from=builder --chown=185 /home/kogito/${PROJECT_ARTIFACT_ID}/target/quarkus-app/quarkus/ /deployments/quarkus/ | ||
|
||
EXPOSE 8080 | ||
USER 185 | ||
ENV AB_JOLOKIA_OFF="" | ||
ENV JAVA_OPTS="-Dquarkus.http.host=0.0.0.0 -Dquarkus.http.port=8080 -Djava.util.logging.manager=org.jboss.logmanager.LogManager" | ||
ENV JAVA_APP_JAR="/deployments/quarkus-run.jar" |
89 changes: 89 additions & 0 deletions
89
tests/shell/kogito-swf-builder/resources/greet-with-inputschema/greet.sw.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
{ | ||
"id": "greeting", | ||
"description": "Greeting example on k8s!", | ||
"version": "0.0.1", | ||
"start": { | ||
"stateName": "ChooseOnLanguage" | ||
}, | ||
"dataInputSchema": { | ||
"schema": "schemas/input.json", | ||
"failOnValidationErrors": true | ||
}, | ||
"specVersion": "0.8", | ||
"expressionLang": "jq", | ||
"states": [ | ||
{ | ||
"name": "ChooseOnLanguage", | ||
"type": "switch", | ||
"defaultCondition": { | ||
"transition": { | ||
"nextState": "GreetInEnglish" | ||
} | ||
}, | ||
"dataConditions": [ | ||
{ | ||
"condition": "${ .language == \"English\" }", | ||
"transition": { | ||
"nextState": "GreetInEnglish" | ||
} | ||
}, | ||
{ | ||
"condition": "${ .language == \"Spanish\" }", | ||
"transition": { | ||
"nextState": "GreetInSpanish" | ||
} | ||
} | ||
] | ||
}, | ||
{ | ||
"name": "GreetInEnglish", | ||
"type": "inject", | ||
"transition": { | ||
"nextState": "GreetPerson" | ||
}, | ||
"data": { | ||
"greeting": "Hello from JSON Workflow, " | ||
} | ||
}, | ||
{ | ||
"name": "GreetInSpanish", | ||
"type": "inject", | ||
"transition": { | ||
"nextState": "GreetPerson" | ||
}, | ||
"data": { | ||
"greeting": "Saludos desde JSON Workflow, " | ||
} | ||
}, | ||
{ | ||
"name": "GreetPerson", | ||
"type": "operation", | ||
"end": { | ||
"terminate": true | ||
}, | ||
"actionMode": "sequential", | ||
"actions": [ | ||
{ | ||
"name": "greetAction", | ||
"functionRef": { | ||
"refName": "greetFunction", | ||
"arguments": { | ||
"message": ".greeting+.name" | ||
}, | ||
"invoke": "sync" | ||
}, | ||
"actionDataFilter": { | ||
"useResults": true | ||
} | ||
} | ||
] | ||
} | ||
], | ||
"functions": [ | ||
{ | ||
"name": "greetFunction", | ||
"operation": "sysout", | ||
"type": "custom" | ||
} | ||
] | ||
} |
16 changes: 16 additions & 0 deletions
16
tests/shell/kogito-swf-builder/resources/greet-with-inputschema/schemas/input.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
{ | ||
"$schema": "http://json-schema.org/draft-04/schema#", | ||
"type": "object", | ||
"properties": { | ||
"language": { | ||
"type": "string" | ||
}, | ||
"name": { | ||
"type": "string" | ||
} | ||
}, | ||
"required": [ | ||
"language", | ||
"name" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
-Xms1024m |
File renamed without changes.
File renamed without changes.