Commit 0f0a8eca authored by Truc Nguyen's avatar Truc Nguyen
Browse files

feat(custom-init): remove javamelody example

parent fa2d125b
...@@ -83,6 +83,11 @@ Here's a sample `register-event-handler.sh` script: ...@@ -83,6 +83,11 @@ Here's a sample `register-event-handler.sh` script:
set -euxo pipefail set -euxo pipefail
indicator_path=/opt/$(basename $BASH_ARGV)-executed
if [ -f ${indicator_path} ]; then
echo "Custom script already executed" && return 0
fi
BONITA_PATH=${BONITA_PATH:-/opt/bonita} BONITA_PATH=${BONITA_PATH:-/opt/bonita}
BONITA_FILES=${BONITA_FILES:-/opt/files} BONITA_FILES=${BONITA_FILES:-/opt/files}
BONITA_SETUP_SH="${BONITA_PATH}/Bonita*Subscription-${BONITA_VERSION}-Tomcat-${TOMCAT_VERSION}/setup/setup.sh" BONITA_SETUP_SH="${BONITA_PATH}/Bonita*Subscription-${BONITA_VERSION}-Tomcat-${TOMCAT_VERSION}/setup/setup.sh"
...@@ -109,37 +114,7 @@ zip -r "${war_path}" "WEB-INF/lib/${EVENT_HANDLER_FILENAME}" ...@@ -109,37 +114,7 @@ zip -r "${war_path}" "WEB-INF/lib/${EVENT_HANDLER_FILENAME}"
${BONITA_SETUP_SH} pull ${BONITA_SETUP_SH} pull
cp /opt/custom-init.d/bonita-tenant-sp-custom.xml ${BONITA_PATH}/Bonita*Subscription-${BONITA_VERSION}-Tomcat-${TOMCAT_VERSION}/setup/platform_conf/current/tenant_template_engine/ cp /opt/custom-init.d/bonita-tenant-sp-custom.xml ${BONITA_PATH}/Bonita*Subscription-${BONITA_VERSION}-Tomcat-${TOMCAT_VERSION}/setup/platform_conf/current/tenant_template_engine/
${BONITA_SETUP_SH} push ${BONITA_SETUP_SH} push
```
### add-javamelody.sh
This sample script deploys the [JavaMelody monitoring tool](https://github.com/javamelody/javamelody/wiki) to Bonita web application. This example shows how to download external jars and include them to Bonita WAR.
With this example, JavaMelody will be available at this URL: `http://<bonita_host>:8081/bonita/monitoring`. # Create indicator file
touch ${indicator_path}
```bash
#!/bin/bash
set -euxo pipefail
BONITA_PATH=${BONITA_PATH:-/opt/bonita}
BONITA_FILES=${BONITA_FILES:-/opt/files}
war_path=$(find "${BONITA_PATH}/Bonita"*"Subscription-${BONITA_VERSION}-Tomcat-${TOMCAT_VERSION}/server/webapps" -name bonita.war)
workdir="${BONITA_FILES}/add-javamelody"
rm -rf ${workdir} && mkdir -p ${workdir}
pushd ${workdir}
# download javamelody jars
mkdir -p WEB-INF/lib
pushd WEB-INF/lib
curl -sSLOJ https://github.com/javamelody/javamelody/releases/download/javamelody-core-1.70.0/javamelody-core-1.70.0.jar
curl -sSLOJ https://repo1.maven.org/maven2/org/jrobin/jrobin/1.5.9/jrobin-1.5.9.jar
popd
# repackage war
zip -r "${war_path}" WEB-INF/lib
``` ```
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment