ricardozanini commented on code in PR #1734:
URL:
https://github.com/apache/incubator-kie-kogito-images/pull/1734#discussion_r1467913413
##########
modules/kogito-swf/common/scripts/module.yaml:
##########
@@ -40,6 +40,9 @@ envs:
description: To use only if you plan to use the
${KOGITO_HOME}/launch/create-app.sh
- name: QUARKUS_ADD_EXTENSION_ARGS
description: To use only if you plan to use the
${KOGITO_HOME}/launch/add-extension.sh
+ - name: SONATA_FLOW_DEPLOYMENT_WEBAPP_VERSION
Review Comment:
```suggestion
- name: SONATAFLOW_DEPLOYMENT_WEBAPP_VERSION
```
##########
modules/kogito-swf/common/scripts/module.yaml:
##########
@@ -40,6 +40,9 @@ envs:
description: To use only if you plan to use the
${KOGITO_HOME}/launch/create-app.sh
- name: QUARKUS_ADD_EXTENSION_ARGS
description: To use only if you plan to use the
${KOGITO_HOME}/launch/add-extension.sh
+ - name: SONATA_FLOW_DEPLOYMENT_WEBAPP_VERSION
+ value: "0.32.0"
+ description: Please do not change. To change only if you plan to use the
${KOGITO_HOME}/launch/create-app.sh
Review Comment:
```suggestion
description: Follow the kie-tooling release train. Avoid changing since
this version might align with the current KIE SonataFlow release
${KOGITO_HOME}/launch/create-app.sh
```
##########
modules/kogito-swf/common/scripts/tests/bats/kogito-swf-builder-create-app.bats:
##########
@@ -0,0 +1,94 @@
+#!/usr/bin/env bats
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+
+setup_file() {
+ export KOGITO_HOME=/tmp/kogito
+ export HOME="${KOGITO_HOME}"
+ export SONATA_FLOW_DEPLOYMENT_WEBAPP_VERSION="0.32.0"
Review Comment:
```suggestion
export SONATAFLOW_DEPLOYMENT_WEBAPP_VERSION="0.32.0"
```
##########
modules/kogito-swf/common/scripts/tests/bats/kogito-swf-builder-create-app.bats:
##########
@@ -0,0 +1,94 @@
+#!/usr/bin/env bats
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+
+setup_file() {
+ export KOGITO_HOME=/tmp/kogito
+ export HOME="${KOGITO_HOME}"
+ export SONATA_FLOW_DEPLOYMENT_WEBAPP_VERSION="0.32.0"
+
+ export PROJECT_ARTIFACT_ID='serverless-workflow-project'
+ export PROJECT_DIR="${KOGITO_HOME}/${PROJECT_ARTIFACT_ID}"
+ export PROJECT_POM="${PROJECT_DIR}"/pom.xml
+ export
SONATAFLOW_DEPLOYMENT_WEBAPP_DATA_JSON_FILENAME="sonataflow-deployment-webapp-data.json"
+ export
SONATAFLOW_DEPLOYMENT_WEBAPP_DATA_JSON="${PROJECT_DIR}/src/main/resources/META-INF/resources/${SONATAFLOW_DEPLOYMENT_WEBAPP_DATA_JSON_FILENAME}"
+
+ mkdir -p ${HOME}/.m2/
+ cp
$BATS_TEST_DIRNAME/../../../../../kogito-maven/common/maven/settings.xml
${HOME}/.m2/
+ export MAVEN_SETTINGS_PATH="${HOME}/.m2/settings.xml"
+
+ mkdir -p "${KOGITO_HOME}"/launch
+
+ cp $BATS_TEST_DIRNAME/../../added/configure-jvm-mvn.sh
"${KOGITO_HOME}"/launch/
+ cp
$BATS_TEST_DIRNAME/../../../../../kogito-maven/common/added/configure-maven.sh
"${KOGITO_HOME}"/launch/
+ cp $BATS_TEST_DIRNAME/../../added/jvm-settings.sh "${KOGITO_HOME}"/launch/
+ cp $BATS_TEST_DIRNAME/../../../../../kogito-logging/added/logging.sh
"${KOGITO_HOME}"/launch/
+ cp $BATS_TEST_DIRNAME/../../added/create-app.sh "${KOGITO_HOME}"/launch/
+ cp $BATS_TEST_DIRNAME/../../added/build-app.sh "${KOGITO_HOME}"/launch/
+ cp $BATS_TEST_DIRNAME/../../added/add-sonataflow-deployment-webapp.sh
"${KOGITO_HOME}"/launch/
+
+ source ${KOGITO_HOME}/launch/configure-maven.sh
+
+ cd "${KOGITO_HOME}"
+ source ${KOGITO_HOME}/launch/create-app.sh
+
+ source ${KOGITO_HOME}/launch/build-app.sh
+}
+
+teardown_file() {
+ rm -rf "${KOGITO_HOME}"
+}
+
+@test "Verify the project contains the pom.xml" {
+ [[ -f $PROJECT_POM ]]
+}
+
+@test "Check the value of the node sonataFlowDeploymentWebapp.version" {
+ result=$(xmllint --xpath
"/*[local-name()='project']/*[local-name()='properties']/*[local-name()='sonataFlowDeploymentWebapp.version']/text()"
$PROJECT_POM)
+ [ "$result" == $SONATA_FLOW_DEPLOYMENT_WEBAPP_VERSION ]
Review Comment:
```suggestion
[ "$result" == $SONATAFLOW_DEPLOYMENT_WEBAPP_VERSION ]
```
##########
modules/kogito-swf/common/scripts/added/add-sonataflow-deployment-webapp.sh:
##########
@@ -0,0 +1,83 @@
+#!/usr/bin/env bash
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+
+# This script adds SonataFlow Deployment Webapp to the pom.xml
+
+set -e
+
+sed -i.bak '/^ <properties>/a\
+
<sonataFlowDeploymentWebapp.version>'"$SONATA_FLOW_DEPLOYMENT_WEBAPP_VERSION"'<\/sonataFlowDeploymentWebapp.version>'
pom.xml
Review Comment:
```suggestion
<sonataFlowDeploymentWebapp.version>'"$SONATAFLOW_DEPLOYMENT_WEBAPP_VERSION"'<\/sonataFlowDeploymentWebapp.version>'
pom.xml
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]