Skip to content

Commit

Permalink
[CLOUD-2251] - Produce Intelligent Process Server and Realtime Decisi…
Browse files Browse the repository at this point in the history
…on Server Images with EAP 7

Signed-off-by: Filippe Spolti <fspolti@redhat.com>
  • Loading branch information
spolti committed Feb 28, 2018
1 parent c85a875 commit 6e54767
Show file tree
Hide file tree
Showing 9 changed files with 135 additions and 56 deletions.
4 changes: 2 additions & 2 deletions os.kieserver.launch/added/kieserver-setup.sh
Expand Up @@ -68,8 +68,8 @@ setupKieServerForOpenShift() {
# generate the KIE Server state file
generateKieServerStateXml > "${KIE_SERVER_STATE_FILE}"

# filter the KIE Server kie-server-jms.xml and ejb-jar.xml files
filterKieJmsFile "${JBOSS_HOME}/standalone/deployments/kie-server.war/META-INF/kie-server-jms.xml"
# filter the KIE Server kie-server-jms-eap7x.xml and ejb-jar.xml files
filterKieJmsFile "${JBOSS_HOME}/standalone/deployments/kie-server.war/META-INF/kie-server-jms-eap7x.xml"
filterKieJmsFile "${JBOSS_HOME}/standalone/deployments/kie-server.war/WEB-INF/ejb-jar.xml"

# filter the KIE Server quartz.properties file
Expand Down
6 changes: 6 additions & 0 deletions os.kieserver.launch/configure.sh
Expand Up @@ -21,3 +21,9 @@ if [ -e ${SOURCES_DIR}/jboss-bpmsuite-*-supplementary-tools.zip ]; then
cp -p ${SCRIPT_DIR}/quartz_tables_mysql.sql ${JBOSS_HOME}/bin/
cp -p ${SCRIPT_DIR}/quartz_tables_postgres.sql ${JBOSS_HOME}/bin/
fi

# Enforces eap70 password policy for the add-user script.
# The default behavior was changed on EAP7, more details on https://issues.jboss.org/browse/CLOUD-2251
if [[ "$JBOSS_EAP_VERSION" == "7."* ]]; then
sed -i "s/password.restriction=WARN/password.restriction=REJECT/" ${JBOSS_HOME}/bin/add-user.properties
fi
34 changes: 34 additions & 0 deletions os.kieserver.webapp/added/META-INF/kie-server-jms-eap7x.xml
@@ -0,0 +1,34 @@
<?xml version="1.0" encoding="UTF-8"?>
<messaging-deployment xmlns="urn:jboss:messaging-activemq-deployment:1.0">
<server name="default">
<jms-destinations>

<!-- Kie Server REQUEST queue -->
<jms-queue name="KIE.SERVER.REQUEST">
<entry name="queue/KIE.SERVER.REQUEST" />
<entry name="java:jboss/exported/jms/queue/KIE.SERVER.REQUEST" />
</jms-queue>

<!-- Kie Server RESPONSE queue -->
<jms-queue name="KIE.SERVER.RESPONSE">
<entry name="queue/KIE.SERVER.RESPONSE" />
<entry name="java:jboss/exported/jms/queue/KIE.SERVER.RESPONSE" />
</jms-queue>

<!-- Kie Server EXECUTOR queue -->
<jms-queue name="KIE.SERVER.EXECUTOR">
<entry name="queue/KIE.SERVER.EXECUTOR" />
</jms-queue>

<!-- JMS queue for signals -->
<!-- enable when external signals are required -->
<!--
<jms-queue name="KIE.SERVER.SIGNAL.QUEUE">
<entry name="queue/KIE.SERVER.SIGNAL" />
<entry name="java:jboss/exported/jms/queue/KIE.SERVER.SIGNAL" />
</jms-queue>
-->

</jms-destinations>
</server>
</messaging-deployment>
@@ -0,0 +1,31 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ JBoss, Home of Professional Open Source
~ Copyright 2011 Red Hat Inc. and/or its affiliates and other contributors
~ as indicated by the @author tags. All rights reserved.
~ See the copyright.txt in the distribution for a
~ full listing of individual contributors.
~
~ This copyrighted material is made available to anyone wishing to use,
~ modify, copy, or redistribute it subject to the terms and conditions
~ of the GNU Lesser General Public License, v. 2.1.
~ This program is distributed in the hope that it will be useful, but WITHOUT A
~ WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
~ PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
~ You should have received a copy of the GNU Lesser General Public License,
~ v.2.1 along with this distribution; if not, write to the Free Software
~ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
~ MA 02110-1301, USA.
-->
<jboss-deployment-structure xmlns="urn:jboss:deployment-structure:1.1">
<deployment>
<dependencies>
<!-- IMPORTANT: when adding dependency (module) here, make sure it is a public one.
Do not add private modules as there is no guarantee they won't be changed or
removed in future. EAP also generates warning(s) during the deployment if
the WAR depends on private modules. -->
<!-- Keep the alphabetical order! -->
<module name="org.apache.xerces"/>
</dependencies>
</deployment>
</jboss-deployment-structure>
24 changes: 18 additions & 6 deletions os.kieserver.webapp/configure.sh
Expand Up @@ -8,15 +8,21 @@ ADDED_METAINF_DIR="${ADDED_DIR}/META-INF"
ADDED_WEBINF_DIR="${ADDED_DIR}/WEB-INF"
SOURCES_DIR="/tmp/artifacts"

BPMSUITE_BASE_DIR="jboss-eap-6.4"
if [[ "$JBOSS_EAP_VERSION" == "6."* ]]; then
BPMSUITE_BASE_DIR="jboss-eap-6.4"
BPMSUITE_DEPLOYABLE_VERSION="eap6.x"
else
BPMSUITE_BASE_DIR="jboss-eap-7.0"
BPMSUITE_DEPLOYABLE_VERSION="eap7.x"
fi
KIE_SERVER_WAR_DIR="${BPMSUITE_BASE_DIR}/standalone/deployments/kie-server.war"
# asterix in WAR_PATH includes kie-server.war/ and kie-server.war.dodeploy
KIE_SERVER_WAR_PATH="${KIE_SERVER_WAR_DIR}*"
KIE_SERVER_METAINF_DIR="${KIE_SERVER_WAR_DIR}/META-INF"
KIE_SERVER_WEBINF_DIR="${KIE_SERVER_WAR_DIR}/WEB-INF"

if [ -e "${SOURCES_DIR}/jboss-bpmsuite-${BPMSUITE_BASE_VERSION}-deployable-eap6.x.zip" ]; then
unzip -q ${SOURCES_DIR}/jboss-bpmsuite-${BPMSUITE_BASE_VERSION}-deployable-eap6.x.zip ${KIE_SERVER_WAR_PATH}
if [ -e "${SOURCES_DIR}/jboss-bpmsuite-${BPMSUITE_BASE_VERSION}-deployable-${BPMSUITE_DEPLOYABLE_VERSION}.zip" ]; then
unzip -q ${SOURCES_DIR}/jboss-bpmsuite-${BPMSUITE_BASE_VERSION}-deployable-${BPMSUITE_DEPLOYABLE_VERSION}.zip ${KIE_SERVER_WAR_PATH}
# only install patch over this version
BPMSUITE_PATCH_DIR="jboss-bpmsuite-${BPMSUITE_PATCH_VERSION}-patch"
BPMSUITE_PATCH_ZIP="${SOURCES_DIR}/${BPMSUITE_PATCH_DIR}.zip"
Expand All @@ -40,18 +46,24 @@ chmod 664 "${KIE_SERVER_WEBINF_DIR}/lib/openshift-kieserver-jms-${OPENSHIFT_KIES
chmod 664 "${KIE_SERVER_WEBINF_DIR}/lib/openshift-kieserver-web-${OPENSHIFT_KIESERVER_VERSION}.jar"

cp -f -p ${ADDED_WEBINF_DIR}/ejb-jar.xml ${KIE_SERVER_WEBINF_DIR}/ejb-jar.xml
cp -f -p ${ADDED_WEBINF_DIR}/jboss-deployment-structure.xml ${KIE_SERVER_WEBINF_DIR}/jboss-deployment-structure.xml
cp -f -p ${ADDED_WEBINF_DIR}/security-filter-rules.properties ${KIE_SERVER_WEBINF_DIR}/security-filter-rules.properties
cp -f -p ${ADDED_WEBINF_DIR}/web.xml ${KIE_SERVER_WEBINF_DIR}/web.xml
# needs to be overwritten by kieserver-launch.sh
chmod 666 "${KIE_SERVER_WEBINF_DIR}/ejb-jar.xml"
chmod 664 "${KIE_SERVER_WEBINF_DIR}/jboss-deployment-structure.xml"
chmod 664 "${KIE_SERVER_WEBINF_DIR}/security-filter-rules.properties"
chmod 664 "${KIE_SERVER_WEBINF_DIR}/web.xml"

cp -f -p ${ADDED_METAINF_DIR}/kie-server-jms.xml ${KIE_SERVER_METAINF_DIR}/kie-server-jms.xml
if [[ "$JBOSS_EAP_VERSION" == "6."* ]]; then
cp -f -p ${ADDED_METAINF_DIR}/kie-server-jms-eap6x.xml ${KIE_SERVER_METAINF_DIR}/kie-server-jms.xml
cp -f -p ${ADDED_WEBINF_DIR}/jboss-deployment-structure-eap6x.xml ${KIE_SERVER_WEBINF_DIR}/jboss-deployment-structure.xml
else
cp -f -p ${ADDED_METAINF_DIR}/kie-server-jms-eap7x.xml ${KIE_SERVER_METAINF_DIR}/kie-server-jms.xml
cp -f -p ${ADDED_WEBINF_DIR}/jboss-deployment-structure-eap7x.xml ${KIE_SERVER_WEBINF_DIR}/jboss-deployment-structure.xml
fi

# needs to be overwritten by kieserver-launch.sh
chmod 666 "${KIE_SERVER_METAINF_DIR}/kie-server-jms.xml"
chmod 664 "${KIE_SERVER_WEBINF_DIR}/jboss-deployment-structure.xml"

# temp files need to be created by kieserver-launch.sh
chmod 777 "${KIE_SERVER_WEBINF_DIR}"
Expand Down
4 changes: 2 additions & 2 deletions tests/features/decisionserver/decisionserver_6_4.feature
Expand Up @@ -13,7 +13,7 @@ Feature: OpenShift Decision Server 6.4 basic tests

Scenario: Checks if the kie-server webapp is deployed.
When container is ready
Then container log should contain JBAS015859: Deployed "kie-server.war"
Then container log should contain Deployed "kie-server.war"

Scenario: Test REST API is secure
When container is ready
Expand Down Expand Up @@ -51,5 +51,5 @@ Feature: OpenShift Decision Server 6.4 basic tests
Then file /opt/eap/standalone/deployments/kie-server.war/WEB-INF/web.xml should contain org.openshift.kieserver
And file /opt/eap/standalone/deployments/kie-server.war/WEB-INF/security-filter-rules.properties should exist
And file /opt/eap/standalone/deployments/kie-server.war/WEB-INF/lib/kie-api-6.5.0.Final-redhat-2.jar should not exist
And file /opt/eap/standalone/deployments/kie-server.war/WEB-INF/lib/kie-api-6.5.0.Final-redhat-7.jar should exist
And file /opt/eap/standalone/deployments/kie-server.war/WEB-INF/lib/kie-api-6.5.0.Final-redhat-19.jar should exist
And file /opt/eap/standalone/deployments/kie-server.war/WEB-INF/lib/openshift-kieserver-common-1.2.0.Final-redhat-1.jar should exist
88 changes: 42 additions & 46 deletions tests/features/processserver/processserver_6_4.feature
Expand Up @@ -13,7 +13,7 @@ Feature: OpenShift Process Server 6.4 basic tests

Scenario: Checks if the kie-server webapp is deployed.
When container is ready
Then container log should contain JBAS015859: Deployed "kie-server.war"
Then Then container log should contain Deployed "kie-server.war"

Scenario: Test REST API is secure
When container is ready
Expand All @@ -37,53 +37,49 @@ Feature: OpenShift Process Server 6.4 basic tests
When container is ready
Then container log should contain QUARTZ_JNDI env not found, skipping SqlImporter

Scenario: Checks if the Quartz was successfully configured with MySQL
Given XML namespaces
| prefix | url |
| ds | urn:jboss:domain:datasources:1.2 |
Scenario: Checks if the Quartz was successfully configured with MySQL
When container is started with env
| variable | value |
| DB_SERVICE_PREFIX_MAPPING | kie-app-mysql=DB,kie-app-mysql=QUARTZ |
| DB_DATABASE | mydb |
| DB_USERNAME | root |
| DB_PASSWORD | password |
| DB_JNDI | java:jboss/datasources/ExampleDS |
| QUARTZ_JNDI | java:jboss/datasources/ExampleDSNotManaged |
| QUARTZ_DATABASE | mydb |
| QUARTZ_USERNAME | root |
| QUARTZ_PASSWORD | password |
| QUARTZ_JTA | false |
| QUARTZ_NONXA | true |
| KIE_APP_MYSQL_SERVICE_HOST | 10.1.1.1 |
| KIE_APP_MYSQL_SERVICE_PORT | 3306 |
Then XML file /opt/eap/standalone/configuration/standalone-openshift.xml should contain value mysql on XPath //ds:datasource/ds:driver
And XML file /opt/eap/standalone/configuration/standalone-openshift.xml should contain value java:jboss/datasources/ExampleDS on XPath //ds:xa-datasource/@jndi-name
And XML file /opt/eap/standalone/configuration/standalone-openshift.xml should contain value java:jboss/datasources/ExampleDSNotManaged on XPath //ds:datasource/@jndi-name
And XML file /opt/eap/standalone/configuration/standalone-openshift.xml should contain value false on XPath //ds:datasource/@jta
| variable | value |
| DB_SERVICE_PREFIX_MAPPING | kie-app-mysql=DB,kie-app-mysql=QUARTZ |
| DB_DATABASE | mydb |
| DB_USERNAME | root |
| DB_PASSWORD | password |
| DB_JNDI | java:jboss/datasources/ExampleDS |
| QUARTZ_JNDI | java:jboss/datasources/ExampleDSNotManaged |
| QUARTZ_DATABASE | mydb |
| QUARTZ_USERNAME | root |
| QUARTZ_PASSWORD | password |
| QUARTZ_JTA | false |
| QUARTZ_NONXA | true |
| KIE_APP_MYSQL_SERVICE_HOST | 10.1.1.1 |
| KIE_APP_MYSQL_SERVICE_PORT | 3306 |
Then XML file /opt/eap/standalone/configuration/standalone-openshift.xml should contain value mysql on XPath //*[local-name()='xa-datasource']/*[local-name()='driver']
Then XML file /opt/eap/standalone/configuration/standalone-openshift.xml should contain value mysql on XPath //*[local-name()='datasource']/*[local-name()='driver']
Then XML file /opt/eap/standalone/configuration/standalone-openshift.xml should contain value java:jboss/datasources/ExampleDS on XPath //*[local-name()='xa-datasource']/@jndi-name
Then XML file /opt/eap/standalone/configuration/standalone-openshift.xml should contain value java:jboss/datasources/ExampleDSNotManaged on XPath //*[local-name()='datasource']/@jndi-name
Then XML file /opt/eap/standalone/configuration/standalone-openshift.xml should contain value false on XPath //*[local-name()='datasource']/@jta

Scenario: Checks if the Quartz was successfully configured with PostgreSQL
Given XML namespaces
| prefix | url |
| ds | urn:jboss:domain:datasources:1.2 |
Scenario: Checks if the Quartz was successfully configured with PostgreSQL
When container is started with env
| variable | value |
| DB_SERVICE_PREFIX_MAPPING | kie-app-postgresql=DB,kie-app-postgresql=QUARTZ |
| DB_DATABASE | mydb |
| DB_USERNAME | root |
| DB_PASSWORD | password |
| DB_JNDI | java:jboss/datasources/ExampleDS |
| QUARTZ_JNDI | java:jboss/datasources/ExampleDSNotManaged |
| QUARTZ_DATABASE | mydb |
| QUARTZ_USERNAME | root |
| QUARTZ_PASSWORD | password |
| QUARTZ_JTA | false |
| QUARTZ_NONXA | true |
| KIE_APP_POSTGRESQL_SERVICE_HOST | 10.1.1.1 |
| KIE_APP_POSTGRESQL_SERVICE_PORT | 5432 |
Then XML file /opt/eap/standalone/configuration/standalone-openshift.xml should contain value postgresql on XPath //ds:datasource/ds:driver
And XML file /opt/eap/standalone/configuration/standalone-openshift.xml should contain value java:jboss/datasources/ExampleDS on XPath //ds:xa-datasource/@jndi-name
And XML file /opt/eap/standalone/configuration/standalone-openshift.xml should contain value java:jboss/datasources/ExampleDSNotManaged on XPath //ds:datasource/@jndi-name
And XML file /opt/eap/standalone/configuration/standalone-openshift.xml should contain value false on XPath //ds:datasource/@jta
| variable | value |
| DB_SERVICE_PREFIX_MAPPING | kie-app-postgresql=DB,kie-app-postgresql=QUARTZ |
| DB_DATABASE | mydb |
| DB_USERNAME | root |
| DB_PASSWORD | password |
| DB_JNDI | java:jboss/datasources/ExampleDS |
| QUARTZ_JNDI | java:jboss/datasources/ExampleDSNotManaged |
| QUARTZ_DATABASE | mydb |
| QUARTZ_USERNAME | root |
| QUARTZ_PASSWORD | password |
| QUARTZ_JTA | false |
| QUARTZ_NONXA | true |
| KIE_APP_POSTGRESQL_SERVICE_HOST | 10.1.1.1 |
| KIE_APP_POSTGRESQL_SERVICE_PORT | 5432 |
Then XML file /opt/eap/standalone/configuration/standalone-openshift.xml should contain value postgresql on XPath //*[local-name()='xa-datasource']/*[local-name()='driver']
And XML file /opt/eap/standalone/configuration/standalone-openshift.xml should contain value postgresql on XPath //*[local-name()='datasource']/*[local-name()='driver']
And XML file /opt/eap/standalone/configuration/standalone-openshift.xml should contain value java:jboss/datasources/ExampleDS on XPath //*[local-name()='xa-datasource']/@jndi-name
And XML file /opt/eap/standalone/configuration/standalone-openshift.xml should contain value java:jboss/datasources/ExampleDSNotManaged on XPath //*[local-name()='datasource']/@jndi-name
And XML file /opt/eap/standalone/configuration/standalone-openshift.xml should contain value false on XPath //*[local-name()='datasource']/@jta

Scenario: check ownership when started as alternative UID
When container is started as uid 26458
Expand All @@ -97,5 +93,5 @@ Feature: OpenShift Process Server 6.4 basic tests
Then file /opt/eap/standalone/deployments/kie-server.war/WEB-INF/web.xml should contain org.openshift.kieserver
And file /opt/eap/standalone/deployments/kie-server.war/WEB-INF/security-filter-rules.properties should exist
And file /opt/eap/standalone/deployments/kie-server.war/WEB-INF/lib/kie-api-6.5.0.Final-redhat-2.jar should not exist
And file /opt/eap/standalone/deployments/kie-server.war/WEB-INF/lib/kie-api-6.5.0.Final-redhat-7.jar should exist
And file /opt/eap/standalone/deployments/kie-server.war/WEB-INF/lib/kie-api-6.5.0.Final-redhat-19.jar should exist
And file /opt/eap/standalone/deployments/kie-server.war/WEB-INF/lib/openshift-kieserver-common-1.2.0.Final-redhat-1.jar should exist

0 comments on commit 6e54767

Please sign in to comment.