diff --git a/.gitignore b/.gitignore index 6e3d355..27d106b 100644 --- a/.gitignore +++ b/.gitignore @@ -2,7 +2,7 @@ /.dockerignore /Dockerfile /.index -/.niogit +/.niogit* /.security /.kie-wb-playground .DS_STORE diff --git a/init.sh b/init.sh index 454a310..0b63831 100755 --- a/init.sh +++ b/init.sh @@ -1,31 +1,33 @@ -#!/bin/sh +#!/bin/bash DEMO="Install Demo" -AUTHORS="Red Hat" PROJECT="git@github.com:jbossdemocentral/rhpam7-install-demo.git" PRODUCT="Red Hat Process Automation Manager" -JBOSS_HOME=./target/jboss-eap-7.3 +JBOSS_HOME=./target/jboss-eap-7.4 SERVER_DIR=$JBOSS_HOME/standalone/deployments SERVER_CONF=$JBOSS_HOME/standalone/configuration/ SERVER_BIN=$JBOSS_HOME/bin SRC_DIR=./installs SUPPORT_DIR=./support PRJ_DIR=./projects -VERSION_EAP=7.3.0 -VERSION=7.11.0 +VERSION_EAP=7.4.0 +VERSION_EAP_PATCH=7.4.6 +VERSION=7.13.0 EAP=jboss-eap-$VERSION_EAP.zip +EAP_PATCH=jboss-eap-$VERSION_EAP_PATCH-patch.zip RHPAM=rhpam-$VERSION-business-central-eap7-deployable.zip RHPAM_KIE_SERVER=rhpam-$VERSION-kie-server-ee8.zip RHPAM_ADDONS=rhpam-$VERSION-add-ons.zip RHPAM_CASE=rhpam-$VERSION-case-mgmt-showcase-eap7-deployable.zip +RHPAM_UPDATE=rhpam-$VERSION-update # wipe screen. -clear +clear echo echo "###################################################################" -echo "## ##" +echo "## ##" echo "## Setting up the ##" -echo "## ##" +echo "## ##" echo "## #### ##### #### # # ### ##### ##" echo "## # # # # # # # # # # ##" echo "## #### ### # # ##### ##### # ##" @@ -49,17 +51,49 @@ echo "## ## ## # # ## # # # # # # # ##" echo "## # # # ##### # # # ##### # ## ### #### ##" echo "## # # # # # ## # # # # # # # ##" echo "## # # # # # # # # ##### ##### # # ##" -echo "## ##" -echo "## brought to you by, ${AUTHORS} ##" -echo "## ##" +echo "## ##" +echo "## ##" echo "## ${PROJECT} ##" -echo "## ##" +echo "## ##" echo "###################################################################" echo -# make some checks first before proceeding. +# Validate that the system is ready for installation. +echo "Testing Java runtime engine (JRE) availability..." +if type -p java; then + echo " - Java executable found in PATH" + export _java=java +elif [[ -n "$JAVA_HOME" ]] && [[ -x "$JAVA_HOME/bin/java" ]]; then + echo " - Java executable found in JAVA_HOME" + export _java="$JAVA_HOME/bin/java" +else + echo "No java runtine availabie!" + echo "Please configure your system path and $JAVA_HOME environment before continuing." + echo + exit +fi + +echo "Testing Java version..." +if [[ "$_java" ]]; then + export _java_version=$("$_java" -version 2>&1 | awk -F '"' '/version/ {print $2}') + echo " - JAVA is version ${_java_version}" + # See: https://stackoverflow.com/a/7335524 + export _java_version_numeric=$(echo "$_java_version" | awk -F. '{printf("%03d%03d",$1,$2);}') + if [ $_java_version_numeric -ge 001008 ] && [ $_java_version_numeric -le 011000 ] ; then + echo " - Java version is compatible with RHPAM" + echo + else + echo " - Java version is incompatible with RHPAM!" + echo " Please configure your Java environment before continuing with installation" + echo " More information at https://access.redhat.com/articles/3405381" + echo + exit + fi +fi + +# Verify that the support directory is available at the expected path if [ -r $SUPPORT_DIR ] || [ -L $SUPPORT_DIR ]; then - echo "Support dir is presented..." + echo "Support dir is available..." echo else echo "$SUPPORT_DIR wasn't found. Please make sure to run this script inside the demo directory." @@ -68,31 +102,41 @@ else fi if [ -r $SRC_DIR/$EAP ] || [ -L $SRC_DIR/$EAP ]; then - echo "Product EAP sources are present..." + echo "EAP product sources are downloaded and present..." +else + echo "Product sources for $EAP package not found." + echo "Please follow the download instructions in README.md," + echo "found in the $SRC_DIR directory to proceed..." echo + exit +fi + +if [ -r $SRC_DIR/$EAP_PATCH ] || [ -L $SRC_DIR/$EAP_PATCH ]; then + echo "EAP patch sources are downloaded and present..." else - echo "Need to download $EAP package from https://developers.redhat.com/products/eap/download" - echo "and place it in the $SRC_DIR directory to proceed..." + echo "Product sources for $EAP_PATCH package not found." + echo "Please follow the download instructions in README.md," + echo "found in the $SRC_DIR directory to proceed..." echo exit fi if [ -r $SRC_DIR/$RHPAM ] || [ -L $SRC_DIR/$RHPAM ]; then - echo "Product Red Hat Process Automation Manager sources are present..." - echo + echo "RHPAM product sources are downloaded and present..." else - echo "Need to download $RHPAM package from https://developers.redhat.com/products/rhpam/download" - echo "and place it in the $SRC_DIR directory to proceed..." + echo "Product sources for $RHPAM package not found." + echo "Please follow the download instructions in README.md," + echo "found in the $SRC_DIR directory to proceed..." echo exit fi if [ -r $SRC_DIR/$RHPAM_KIE_SERVER ] || [ -L $SRC_DIR/$RHPAM_KIE_SERVER ]; then echo "Product Red Hat Process Automation Manager KIE Server sources are present..." - echo else - echo "Need to download $RHPAM_KIE_SERVER package from https://developers.redhat.com/products/rhpam/download" - echo "and place it in the $SRC_DIR directory to proceed..." + echo "Product sources for $RHPAM_KIE_SERVER package not found." + echo "Please follow the download instructions in README.md," + echo "found in the $SRC_DIR directory to proceed..." echo exit fi @@ -101,59 +145,71 @@ if [ -r $SRC_DIR/$RHPAM_ADDONS ] || [ -L $SRC_DIR/$RHPAM_ADDONS ]; then echo "Product Red Hat Process Automation Manager Case Management sources are present..." echo else - echo "Need to download $RHPAM_ADDONS package from https://developers.redhat.com/products/rhpam/download" - echo "and place it in the $SRC_DIR directory to proceed..." + echo "Product sources for $RHPAM_ADDONS package not found." + echo "Please follow the download instructions in README.md," + echo "found in the $SRC_DIR directory to proceed..." echo exit fi # Remove the old JBoss instance, if it exists. if [ -x $JBOSS_HOME ]; then - echo " - removing existing JBoss product..." + echo "Removing existing installation from $JBOSS_HOME..." echo rm -rf $JBOSS_HOME fi -# Installation. -echo "JBoss EAP installation running now..." +# JBoss EAP Installation. +echo "Extracting JBoss EAP ${VERSION_EAP}..." echo mkdir -p ./target unzip -qo $SRC_DIR/$EAP -d target if [ $? -ne 0 ]; then echo - echo Error occurred during JBoss EAP installation! + echo Error occurred during JBoss EAP extraction! exit fi -echo "Red Hat Process Automation Manager installation running now..." +echo "Patching the JBoss EAP installation to ${VERSION_EAP_PATCH}..." +echo +$JBOSS_HOME/bin/jboss-cli.sh "patch apply $SRC_DIR/jboss-eap-7.4.6-patch.zip" echo -unzip -qo $SRC_DIR/$RHPAM -d target if [ $? -ne 0 ]; then echo - echo Error occurred during Red Hat Process Manager installation! + echo Error occurred while patching JBoss EAP! exit fi -echo "Red Hat Process Automation Manager Kie Server installation running now..." +# RHPAM Installation. +echo "Extracting Red Hat Process Automation Manager..." echo -unzip -qo $SRC_DIR/$RHPAM_KIE_SERVER -d $JBOSS_HOME/standalone/deployments +unzip -qo $SRC_DIR/$RHPAM -d target if [ $? -ne 0 ]; then echo - echo Error occurred during Red Hat Process Manager Kie Server installation! + echo Error occurred during Red Hat Process Manager extraction! exit fi -# Set deployment Kie Server. +echo "Extracting Red Hat Process Automation Manager - Kie Server..." +echo +unzip -qo $SRC_DIR/$RHPAM_KIE_SERVER -d $JBOSS_HOME/standalone/deployments touch $JBOSS_HOME/standalone/deployments/kie-server.war.dodeploy -echo "Red Hat Process Automation Manager Case Management installation running now..." +if [ $? -ne 0 ]; then + echo + echo Error occurred during Red Hat Process Manager Kie Server installation! + exit +fi + +echo "Extracting Red Hat Process Automation Manager - Case Management Showcase..." echo unzip -qo $SRC_DIR/$RHPAM_ADDONS $RHPAM_CASE -d $SRC_DIR unzip -qo $SRC_DIR/$RHPAM_CASE -d target rm $SRC_DIR/$RHPAM_CASE +touch $JBOSS_HOME/standalone/deployments/rhpam-case-mgmt-showcase.war.dodeploy if [ $? -ne 0 ]; then echo @@ -161,52 +217,50 @@ if [ $? -ne 0 ]; then exit fi -# Set deployment Case Management. -touch $JBOSS_HOME/standalone/deployments/rhpam-case-mgmt-showcase.war.dodeploy +echo " - setting up standalone.xml configuration adjustments..." +echo +mv $SERVER_CONF/standalone.xml $SERVER_CONF/standalone-original.xml +cp $SERVER_CONF/standalone-full.xml $SERVER_CONF/standalone.xml -echo " - enabling demo accounts role setup..." +echo " - setting up data storage folders..." echo -echo " - adding user 'pamAdmin' with password 'redhatpam1!'..." +$JBOSS_HOME/bin/jboss-cli.sh --file=$SUPPORT_DIR/data_folders.cli echo -$JBOSS_HOME/bin/add-user.sh -a -r ApplicationRealm -u pamAdmin -p redhatpam1! -ro analyst,admin,manager,user,kie-server,kiemgmt,rest-all --silent -echo " - adding user 'adminUser' with password 'test1234!'..." +echo " - enabling the KIE Server to be managed by Business Central..." echo -$JBOSS_HOME/bin/add-user.sh -a -r ApplicationRealm -u adminUser -p test1234! -ro analyst,admin,manager,user,kie-server,kiemgmt,rest-all --silent - -echo " - adding user 'kieserver' with password 'kieserver1!'..." +$JBOSS_HOME/bin/jboss-cli.sh --file=$SUPPORT_DIR/managed_kie.cli echo -$JBOSS_HOME/bin/add-user.sh -a -r ApplicationRealm -u kieserver -p kieserver1! -ro kie-server,rest-all --silent -echo " - adding user 'caseUser' with password 'redhatpam1!'..." +# Create our demo user accounts +echo " - setting up demo user accounts and roles..." echo -$JBOSS_HOME/bin/add-user.sh -a -r ApplicationRealm -u caseUser -p redhatpam1! -ro user --silent - -echo " - adding user 'caseManager' with password 'redhatpam1!'..." +# Optional - uncomment the line below to use the file system instead of property files +# $JBOSS_HOME/bin/elytron-tool.sh filesystem-realm --users-file application-users.properties --roles-file application-roles.properties --output-location kie-fs-realm-users +$JBOSS_HOME/bin/jboss-cli.sh --file=$SUPPORT_DIR/user_data.cli echo -$JBOSS_HOME/bin/add-user.sh -a -r ApplicationRealm -u caseManager -p redhatpam1! -ro user,manager --silent -echo " - adding user 'caseSupplier' with password 'redhatpam1!'..." -echo -$JBOSS_HOME/bin/add-user.sh -a -r ApplicationRealm -u caseSupplier -p redhatpam1! -ro user,supplier --silent +# Setting up Setup LDAP based authentication in JBoss EAP 7.1 or later using Elytron +# See https://access.redhat.com/solutions/3220741 -echo " - setting up standalone.xml configuration adjustments..." -echo -cp $SUPPORT_DIR/standalone-full.xml $SERVER_CONF/standalone.xml +# TODO + +# Elytron Failover Realm allows to failover the Identity Lookup to another Identity Store in case of a failure +# See https://access.redhat.com/solutions/6290451 + +# TODO -echo " - setup email task notification users..." +echo " - provisioning email task notification users..." echo cp $SUPPORT_DIR/userinfo.properties $SERVER_DIR/business-central.war/WEB-INF/classes/ - echo " - setup system property for jpa marshaller" echo $JBOSS_HOME/bin/jboss-cli.sh </installs/jboss-eap-7.3.0.zip -chmod +x /installs/rhpam-7.11.0-business-central-eap7-deployable.zip -chmod +x /installs/rhpam-7.11.0-kie-server-ee8.zip -chmod +x /installs/rhpam-7.11.0-add-ons.zip diff --git a/installs/README.md b/installs/README.md new file mode 100644 index 0000000..857be6f --- /dev/null +++ b/installs/README.md @@ -0,0 +1,24 @@ +Before running the installation script, download the RHPAM and EAP product sources from the Red Hat Customer Portal. +Note that you will be required to login using valid portal credentials in order to download enterprise software. + +After downloading, copy or move the zip files into this folder (installs) to make them accessible to the installation script. + + +Download EAP from https://access.redhat.com/jbossnetwork/restricted/listSoftware.html?product=appplatform&downloadType=distributions&version=7.4 + + * Red Hat Enterprise Application Platform archive + (jboss-eap-7.4.0.zip) + + * Red Hat JBoss Enterprise Application Platform 7.4 Update 06 + (jboss-eap-7.4.6-patch.zip) + +Download RHPAM from https://access.redhat.com/jbossnetwork/restricted/listSoftware.html?product=rhpam&downloadType=distributions + + * Red Hat Process Automation Manager 7.13.0 Business Central Deployable for EAP 7 + (rhpam-7.13.0-business-central-eap7-deployable.zip) + + * Red Hat Process Automation Manager 7.13.0 Process Server for All Supported EE8 Containers + (rhpam-7.13.0-kie-server-ee8.zip) + + * Red Hat Process Automation Manager 7.13.0 Add-Ons + (rhpam-7.13.0-add-ons.zip) diff --git a/support/README b/support/README.md similarity index 100% rename from support/README rename to support/README.md diff --git a/support/data_folders.cli b/support/data_folders.cli new file mode 100644 index 0000000..30517a7 --- /dev/null +++ b/support/data_folders.cli @@ -0,0 +1,8 @@ +# These properties define where the various data directories are located + +embed-server --std-out=echo + +/system-property=org.uberfire.nio.git.dir:add(value="${jboss.server.data.dir}") +/system-property=org.kie.server.repo:add(value="${jboss.server.data.dir}") +/system-property=org.uberfire.metadata.index.dir:add(value="${jboss.server.data.dir}") +/system-property=org.guvnor.m2repo.dir:add(value="${jboss.server.data.dir}") \ No newline at end of file diff --git a/support/managed_kie.cli b/support/managed_kie.cli new file mode 100644 index 0000000..aab345b --- /dev/null +++ b/support/managed_kie.cli @@ -0,0 +1,14 @@ +# Allows Business Central to manage and deploy to the KIE server +# +# In the original standalone.xml, see the commented out section that says: +# Please uncomment the following properties to make KIE Server to be managed by Business Central + +embed-server --std-out=echo + +/system-property=org.kie.server.location:add(value="http://localhost:8080/kie-server/services/rest/server") +/system-property=org.kie.server.controller:add(value="http://localhost:8080/business-central/rest/controller") +/system-property=org.kie.server.controller.user:add(value="kieserver") +/system-property=org.kie.server.controller.pwd:add(value="kieserver1!") +/system-property=org.kie.server.user:add(value="kieserver") +/system-property=org.kie.server.pwd:add(value="kieserver1!") +/system-property=org.kie.server.id:add(value="default-kieserver") \ No newline at end of file diff --git a/support/openshift/provision.ps1 b/support/openshift/provision.ps1 index b4f6d6e..d0c3ac0 100644 --- a/support/openshift/provision.ps1 +++ b/support/openshift/provision.ps1 @@ -106,9 +106,9 @@ $KIE_SERVER_USER="kieserver" $KIE_SERVER_PWD="kieserver1!" # Version Configuration Parameters -$OPENSHIFT_PAM7_TEMPLATES_TAG="7.11.0.GA" -$IMAGE_STREAM_TAG="7.11.0" -$PAM7_VERSION="711" +$OPENSHIFT_PAM7_TEMPLATES_TAG="7.13.0.GA" +$IMAGE_STREAM_TAG="7.13.0" +$PAM7_VERSION="713" ################################################################################ diff --git a/support/openshift/provision.sh b/support/openshift/provision.sh index 86b4f1f..a83c978 100755 --- a/support/openshift/provision.sh +++ b/support/openshift/provision.sh @@ -165,9 +165,9 @@ KIE_SERVER_USER=kieserver KIE_SERVER_PWD=kieserver1! # Version Configuration Parameters -OPENSHIFT_PAM7_TEMPLATES_TAG=7.11.0.GA -IMAGE_STREAM_TAG=7.11.0 -PAM7_VERSION=711 +OPENSHIFT_PAM7_TEMPLATES_TAG=7.13.0.GA +IMAGE_STREAM_TAG=7.13.0 +PAM7_VERSION=713 ################################################################################ diff --git a/support/standalone-full.xml b/support/standalone-full.xml deleted file mode 100644 index 439f1f5..0000000 --- a/support/standalone-full.xml +++ /dev/null @@ -1,579 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - jdbc:h2:mem:test;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=FALSE - h2 - - sa - sa - - - - - org.h2.jdbcx.JdbcDataSource - - - - - - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ${jboss.bind.address:127.0.0.1} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/support/user_data.cli b/support/user_data.cli new file mode 100644 index 0000000..80af44a --- /dev/null +++ b/support/user_data.cli @@ -0,0 +1,36 @@ +# See RHPAM docs for more information about this file: +# https://access.redhat.com/documentation/en-us/red_hat_process_automation_manager/7.13/html/installing_and_configuring_red_hat_process_automation_manager/assembly_installing-on-eap-deployable_install-on-eap#eap-users-create-proc_install-on-eap +# +# Note - there is a bug in the docs where passwords are enclosed by single quotes (e.g. password='redhatpam1!'). +# This is incorrect, the quotes must be removed in the CLI commands. + +embed-server --std-out=echo + +batch + +echo Adding user: pamAdmin +/subsystem=elytron/filesystem-realm=ApplicationRealm:add-identity(identity=pamAdmin) +/subsystem=elytron/filesystem-realm=ApplicationRealm:set-password(identity=pamAdmin, clear={password=redhatpam1!}) +/subsystem=elytron/filesystem-realm=ApplicationRealm:add-identity-attribute(identity=pamAdmin, name=role, value=[analyst,admin,manager,user,kie-server,kiemgmt,rest-all]) + +echo Adding user: kieserver +/subsystem=elytron/filesystem-realm=ApplicationRealm:add-identity(identity=kieserver) +/subsystem=elytron/filesystem-realm=ApplicationRealm:set-password(identity=kieserver, clear={password=kieserver1!}) +/subsystem=elytron/filesystem-realm=ApplicationRealm:add-identity-attribute(identity=kieserver, name=role, value=[kie-server,rest-all]) + +echo Adding user: caseUser +/subsystem=elytron/filesystem-realm=ApplicationRealm:add-identity(identity=caseUser) +/subsystem=elytron/filesystem-realm=ApplicationRealm:set-password(identity=caseUser, clear={password=redhatpam1!}) +/subsystem=elytron/filesystem-realm=ApplicationRealm:add-identity-attribute(identity=caseUser, name=role, value=[user]) + +echo Adding user: caseManager +/subsystem=elytron/filesystem-realm=ApplicationRealm:add-identity(identity=caseManager) +/subsystem=elytron/filesystem-realm=ApplicationRealm:set-password(identity=caseManager, clear={password=redhatpam1!}) +/subsystem=elytron/filesystem-realm=ApplicationRealm:add-identity-attribute(identity=caseManager, name=role, value=[user,manager]) + +echo Adding user: caseSupplier +/subsystem=elytron/filesystem-realm=ApplicationRealm:add-identity(identity=caseSupplier) +/subsystem=elytron/filesystem-realm=ApplicationRealm:set-password(identity=caseSupplier, clear={password=redhatpam1!}) +/subsystem=elytron/filesystem-realm=ApplicationRealm:add-identity-attribute(identity=caseSupplier, name=role, value=[user,supplier]) + +run-batch