Commit 99b4c4fd authored by Bonita CI's avatar Bonita CI
Browse files

Merge branch 'master' into 'dev'

parents 814de04c 42a25600
Bonitasoft docker images
=========================
## Build SNAPSHOT version
```
./build.sh --
```
## Build TAG version
```
docker build -t bonitasoft/bonita:<VERSION> .
```
## Test
Tests uses [goss](https://github.com/aelsabbahy/goss). It needs to be installed first.
**_Note_**: No need to build image prior to running tests
```
cd test && ./runTests.sh
```
...@@ -149,7 +149,9 @@ sed -e 's/{{DB_VENDOR}}/'"${DB_VENDOR}"'/' \ ...@@ -149,7 +149,9 @@ sed -e 's/{{DB_VENDOR}}/'"${DB_VENDOR}"'/' \
-i ${BONITA_PATH}/BonitaCommunity-${BONITA_VERSION}/setup/database.properties -i ${BONITA_PATH}/BonitaCommunity-${BONITA_VERSION}/setup/database.properties
# apply logging configuration # apply logging configuration
cp ${BONITA_FILES}/logging.properties ${BONITA_PATH}/BonitaCommunity-${BONITA_VERSION}/server/conf/logging.properties LOGGING_FILE=${BONITA_PATH}/BonitaCommunity-${BONITA_VERSION}/server/conf/logging.properties
mv ${LOGGING_FILE} ${LOGGING_FILE}.original
awk -f ${BONITA_FILES}/logging.awk ${LOGGING_FILE}.original > ${LOGGING_FILE}
# use the setup tool to initialize and configure Bonita Tomcat bundle # use the setup tool to initialize and configure Bonita Tomcat bundle
cd /opt/bonita/BonitaCommunity-${BONITA_VERSION} cd /opt/bonita/BonitaCommunity-${BONITA_VERSION}
......
# start by adding a few lines specific to docker logging:
BEGIN {
print "handlers = java.util.logging.ConsoleHandler\n"
print ".handlers = java.util.logging.ConsoleHandler"
print "# The default logging level when not specifically defined"
print ".level= INFO\n"
print "# The minimum level to log"
print "java.util.logging.ConsoleHandler.level = INFO"
print "java.util.logging.ConsoleHandler.formatter = org.apache.juli.BonitaSimpleFormatter\n"
}
# read file and skip all lines until finding the marker:
($0 ~ /^##### DO NOT MODIFY THIS LINE.*/) { started = ! started; next }
# then print all following lines without modifying them:
started { print }
\ No newline at end of file
handlers = java.util.logging.ConsoleHandler
.handlers = java.util.logging.ConsoleHandler
# The default logging level when not specifically defined
.level= INFO
# The minimum level to log
java.util.logging.ConsoleHandler.level = INFO
java.util.logging.ConsoleHandler.formatter = org.apache.juli.BonitaSimpleFormatter
# Allow logging to trace the actual logger producer class:
org.apache.juli.BonitaSimpleFormatter.format=%1$tF %1$tT.%1$tL %1$tz %4$s (%7$s) %3$s %5$s%6$s%n
# Use the following format to remove timestamp:
#java.util.logging.SimpleFormatter.format=%4$s: %3$s %5$s%6$s%n
# By default for development it's a good idea to set the default level for all Bonita component to INFO.
# In production WARNING is a good choice.
org.bonitasoft.level = WARNING
com.arjuna.level = INFO
org.jboss.narayana.tomcat.jta.level = FINE
# At platform initial setup, activate FINE messages on what is happening:
org.bonitasoft.platform.level = INFO
org.bonitasoft.engine.EngineInitializer.level = INFO
# If you want to have more log on connectors execution only, you can activate and modify the following lines
#org.bonitasoft.engine.core.connector.level = FINE
#org.bonitasoft.engine.connector.level = FINE
# If you want to have more log on expressions only, you can activate and modify the following lines
#org.bonitasoft.engine.expression.level = FINE
#org.bonitasoft.engine.data.instance.api.DataExpressionExecutorStrategy.level = FINE
# If you want to have more log on input/output of API calls, you can activate and modify the following line
#org.bonitasoft.engine.api.level = FINEST
# If you want to have more log on Asynchronous executions (Work/Job), you can activate and modify the following lines
#org.bonitasoft.engine.work.level = FINE
#org.bonitasoft.engine.execution.work.level = FINE
#org.bonitasoft.engine.job.level = FINE
#org.bonitasoft.engine.jobs.level = FINE
#org.bonitasoft.engine.scheduler.level = FINE
# Display monitoring information when property 'org.bonitasoft.engine.monitoring.publisher.logging.enable' is set to true in configuration file 'bonita-platform-community-custom.properties'
org.bonitasoft.engine.configuration.monitoring.LoggingMeterRegistry.level = INFO
# Specific logger for auditing work execution
BONITA_WORK_AUDIT.EXECUTION.level = INFO
# If you want to deactivate warnings on wrong handling of transient data
#org.bonitasoft.engine.operation.TransientDataLeftOperandHandler.level = SEVERE
#org.bonitasoft.engine.expression.ReevaluatingTransientDataExpressionExecutorStrategy.level = SEVERE
# Hibernate is used by Bonita and very verbose in the log. Should stay with WARNING level except when debugging database access issues
org.hibernate.level = WARNING
# Remove wrong warnings about ehcache:
org.hibernate.orm.cache.level = SEVERE
# enable tracking of slow execution queries:
org.hibernate.SQL_SLOW.level = INFO
# Ehcache is used by Bonita and very verbose in the log. Should stay with WARNING level except when debugging cache issues
net.sf.ehcache.level = WARNING
# Deactivate annoying false warning:
org.hibernate.type.TypeFactory.level = SEVERE
org.springframework.level = WARNING
org.bonitasoft.engine.service.impl.BonitaSpringContext.level = WARNING
# tuckey
org.tuckey.level = WARNING
# If you want to have more log on rest api extension provided logger, you can activate and modify the following lines
#org.bonitasoft.api.extension.level = FINE
#!/usr/bin/env bash
set -euxo pipefail
echo "GOSS: custom-init.d script $BASH_ARGV!"
#!/usr/bin/env bash
set -euxo pipefail
echo "GOSS: custom-init.d script $BASH_ARGV!"
#!/usr/bin/env bash
set -euxo pipefail
echo "GOSS: custom-init.d script $BASH_ARGV!"
#!/usr/bin/env bash
set -euxo pipefail
echo "GOSS: custom-init.d script $BASH_ARGV!"
#!/usr/bin/env bash
set -euxo pipefail
echo "GOSS: custom-init.d script $BASH_ARGV!"
group:
bonita:
# required attributes
exists: true
# optional attributes
gid: 1000
user:
bonita:
# required attributes
exists: true
# optional attributes
uid: 1000
gid: 1000
groups:
- bonita
shell: /sbin/nologin
file:
/opt/bonita:
# required attributes
exists: true
# optional attributes
owner: bonita
group: bonita
filetype: directory # file, symlink, directory
/opt/bonita_lic:
# required attributes
exists: true
# optional attributes
owner: bonita
group: bonita
filetype: directory # file, symlink, directory
/opt/custom-init.d:
# required attributes
exists: true
# optional attributes
filetype: directory # file, symlink, directory
/opt/files:
# required attributes
exists: true
# optional attributes
filetype: directory # file, symlink, directory
/opt/templates:
# required attributes
exists: true
# optional attributes
filetype: directory # file, symlink, directory
command:
# not using port command here to support both tcp and tcp6
ss -ntl | grep 8080:
title: Checking port 8080 is listening
exit-status: 0
env | sort:
title: Checking environment variables
exit-status: 0
stdout:
- BONITA_VERSION
ps -eo args | grep java:
title: Checking that Tomcat is running
exit-status: 0
stdout:
- /org.apache.catalina.startup.Bootstrap start/
ls -1 /opt/bonita/Bonita*/setup/lib/{{getEnv "DB_VENDOR"}}*:
title: Checking that JDBC driver is present
exit-status: 0
grep 'db.vendor={{getEnv "DB_VENDOR"}}' /opt/bonita/Bonita*/setup/database.properties:
title: Checking database.properties DB_VENDOR
exit-status: 0
grep 'server.name={{getEnv "DB_HOST"}}' /opt/bonita/Bonita*/setup/database.properties:
title: Checking database.properties DB_HOST
exit-status: 0
grep 'server.port={{getEnv "DB_PORT"}}' /opt/bonita/Bonita*/setup/database.properties:
title: Checking database.properties DB_PORT
exit-status: 0
find /opt/bonita/Bonita*/setup/platform_conf/initial -name *.properties | xargs -n10 grep '^userName={{getEnv "TENANT_LOGIN"}}' | [ $(wc -l) -gt 0 ]:
title: Checking custom TENANT_LOGIN
exit-status: 0
find /opt/bonita/Bonita*/setup/platform_conf/initial -name *.properties | xargs -n10 grep '^userPassword={{getEnv "TENANT_PASSWORD"}}' | [ $(wc -l) -gt 0 ]:
title: Checking custom TENANT_PASSWORD
exit-status: 0
find /opt/bonita/Bonita*/setup/platform_conf/initial -name *.properties | xargs -n10 grep '^platformAdminUsername={{getEnv "PLATFORM_LOGIN"}}' | [ $(wc -l) -gt 0 ]:
title: Checking custom PLATFORM_LOGIN
exit-status: 0
find /opt/bonita/Bonita*/setup/platform_conf/initial -name *.properties | xargs -n10 grep '^platformAdminPassword={{getEnv "PLATFORM_PASSWORD"}}' | [ $(wc -l) -gt 0 ]:
title: Checking custom PLATFORM_PASSWORD
exit-status: 0
file:
/goss/docker_output.log:
title: Checking that custom-init.d script is executed
# required attributes
exists: true
contains:
- 'GOSS: custom-init.d script /opt/custom-init.d/init-hello.sh!'
command:
cat /goss/docker_output.log | tr -d '\n' | grep -c "init-1.sh.*init-2.sh.*init-13.sh.*init-hello.sh.*_init-0.sh":
title: Checking that custom-init.d scripts are executed in order
exit-status: 0
stdout: ["1"]
http:
http://localhost:8080/bonita:
title: Checking http://localhost:8080/bonita HTTP status
# required attributes
status: 200
# optional attributes
allow-insecure: false
no-follow-redirects: false # Setting this to true will NOT follow redirects
timeout: 5000
gossfile:
goss_common.yaml: {}
command:
echo "community_env" && env | sort:
title: Checking community environment variables
exit-status: 0
stdout:
- BONITA_SHA256
- BONITA_URL
gossfile:
{{getEnv "GOSSFILE"}}: {}
file:
/goss/docker_output.log:
exists: true
contains:
- /org.apache.catalina.startup.Catalina.*Server startup in/
http:
http://localhost:8080:
status:
gt: 0
#!/usr/bin/env bash
set -euo pipefail
if [ "$#" -gt 0 ]
then
SCRIPT_NAME=$(basename "$0")
echo "Usage: $SCRIPT_NAME"
exit 1
fi
# configure trap to always stop and remove postgres container at the end
trap 'echo "Stopping postgres container"; docker stop bonita_db' INT TERM EXIT
# start postgres container
POSTGRES_VERSION=9.3
POSTGRES_PASSWORD=s3crEt
docker run --rm --name bonita_db -e POSTGRES_PASSWORD=${POSTGRES_PASSWORD} -d postgres:${POSTGRES_VERSION}
# wait for postgres
until docker run --rm --link bonita_db postgres:${POSTGRES_VERSION} pg_isready -h bonita_db -p 5432; do
>&2 echo "Postgres is unavailable - sleeping"
sleep 1
done
>&2 echo "Postgres is up!"
# start bonita container tests
: ${BONITA_VERSION:=$(grep -oP "^ENV BONITA_VERSION \K.*" "../Dockerfile" | sed 's/.*:-\(.*\)}$/\1/' | tail -1)}
DGOSS_CMD="dgoss run --rm --name bonita_${BONITA_VERSION} --link bonita_db \
-e DB_VENDOR=postgres -e DB_HOST=bonita_db -e DB_PORT=5432 -e DB_ADMIN_PASS=${POSTGRES_PASSWORD} \
-e TENANT_LOGIN=tenant_admin -e TENANT_PASSWORD=tenant_pass \
-e PLATFORM_LOGIN=platform_admin -e PLATFORM_PASSWORD=platform_pass \
-v $(pwd)/custom-init.d:/opt/custom-init.d"
export GOSS_WAIT_OPTS="-r 60s -s 2s > /dev/null"
export GOSSFILE=goss_community.yaml
goss -g goss_main.yaml render > goss.yaml && ${DGOSS_CMD} \
bonitasoft/bonita:${BONITA_VERSION}
...@@ -11,11 +11,6 @@ handlers = java.util.logging.ConsoleHandler, 1bonita.org.apache.juli.AsyncFileHa ...@@ -11,11 +11,6 @@ handlers = java.util.logging.ConsoleHandler, 1bonita.org.apache.juli.AsyncFileHa
# 2017-05-11 12:09:10.201 +0200 INFOS: org.bonitasoft.platform.configuration.util.AllConfigurationResourceVisitor found file: tenant_template_engine/bonita-tenants-custom.xml # 2017-05-11 12:09:10.201 +0200 INFOS: org.bonitasoft.platform.configuration.util.AllConfigurationResourceVisitor found file: tenant_template_engine/bonita-tenants-custom.xml
java.util.logging.SimpleFormatter.format=%1$tF %1$tT.%1$tL %1$tz %4$s: %3$s %5$s%6$s%n java.util.logging.SimpleFormatter.format=%1$tF %1$tT.%1$tL %1$tz %4$s: %3$s %5$s%6$s%n
# Custom formatter to be able to see thread name in the log (thread name available at position 7)
org.apache.juli.BonitaSimpleFormatter.format=%1$tF %1$tT.%1$tL %1$tz %4$s (%7$s) %3$s %5$s%6$s%n
# Produced logs
# 2019-11-07 17:37:16.474 +0100 INFOS (localhost-startStop-1) org.bonitasoft.engine.scheduler.impl.BonitaSchedulerFactory Using default implementation for ThreadExecutor
############################################################ ############################################################
# Handler specific properties. # Handler specific properties.
# Describes specific configuration info for Handlers. # Describes specific configuration info for Handlers.
...@@ -42,6 +37,15 @@ org.apache.juli.BonitaSimpleFormatter.format=%1$tF %1$tT.%1$tL %1$tz %4$s (%7$s) ...@@ -42,6 +37,15 @@ org.apache.juli.BonitaSimpleFormatter.format=%1$tF %1$tT.%1$tL %1$tz %4$s (%7$s)
org.apache.catalina.core.ContainerBase.[Catalina].[localhost].level = INFO org.apache.catalina.core.ContainerBase.[Catalina].[localhost].level = INFO
org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/bonita].level = INFO org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/bonita].level = INFO
#############################################################################################
##### DO NOT MODIFY THIS LINE, IT IS USED TO ADAPT THE FILE TO THE DOCKER IMAGE VERSION #####
#############################################################################################
# Custom formatter to be able to see thread name in the log (thread name available at position 7)
org.apache.juli.BonitaSimpleFormatter.format=%1$tF %1$tT.%1$tL %1$tz %4$s (%7$s) %3$s %5$s%6$s%n
# Produced logs
# 2019-11-07 17:37:16.474 +0100 INFOS (localhost-startStop-1) org.bonitasoft.engine.scheduler.impl.BonitaSchedulerFactory Using default implementation for ThreadExecutor
# For example, set the org.apache.catalina.util.LifecycleBase logger to log # For example, set the org.apache.catalina.util.LifecycleBase logger to log
# each component that extends LifecycleBase changing state: # each component that extends LifecycleBase changing state:
#org.apache.catalina.util.LifecycleBase.level = FINE #org.apache.catalina.util.LifecycleBase.level = FINE
......
Markdown is supported
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