Permalink
Cannot retrieve contributors at this time
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
midPoint_container/container_files/usr-local-bin/start-midpoint.sh
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
executable file
61 lines (56 sloc)
2.48 KB
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
function check () { | |
local VARNAME=$1 | |
if [ -z ${!VARNAME} ]; then | |
echo "*** Couldn't start midPoint: $VARNAME variable is undefined. Please check your Docker composition." | |
exit 1 | |
fi | |
} | |
echo "Linking secrets" | |
for filepath in /run/secrets/*; do | |
label_file=`basename $filepath` | |
if [ "$label_file" == "mp_shibboleth_sp_keys.jks" ]; then | |
if [ ! -d "/etc/pki/mp" ]; then | |
mkdir /etc/pki/mp | |
fi | |
ln -sf /run/secrets/mp_shibboleth_sp_keys.jks /etc/pki/mp/sp-shibboleth-keys.jks | |
fi | |
done | |
# These variables have reasonable defaults in Dockerfile. So we will _not_ supply defaults here. | |
# The composer or user has to make sure they are well defined. | |
check MP_MEM_MAX | |
check MP_MEM_INIT | |
check MP_DIR | |
check REPO_DATABASE_TYPE | |
check REPO_USER | |
check REPO_PASSWORD_FILE | |
check REPO_MISSING_SCHEMA_ACTION | |
check REPO_UPGRADEABLE_SCHEMA_ACTION | |
check MP_KEYSTORE_PASSWORD_FILE | |
check AJP_ENABLED | |
check AJP_PORT | |
java -Xmx$MP_MEM_MAX -Xms$MP_MEM_INIT -Dfile.encoding=UTF8 \ | |
-Dmidpoint.home=$MP_DIR/var \ | |
-Dmidpoint.repository.database=$REPO_DATABASE_TYPE \ | |
-Dmidpoint.repository.jdbcUsername=$REPO_USER \ | |
-Dmidpoint.repository.jdbcPassword_FILE=$REPO_PASSWORD_FILE \ | |
-Dmidpoint.repository.jdbcUrl="`$MP_DIR/repository-url`" \ | |
-Dmidpoint.repository.hibernateHbm2ddl=none \ | |
-Dmidpoint.repository.missingSchemaAction=$REPO_MISSING_SCHEMA_ACTION \ | |
-Dmidpoint.repository.upgradeableSchemaAction=$REPO_UPGRADEABLE_SCHEMA_ACTION \ | |
$(if [ -n "$REPO_SCHEMA_VERSION_IF_MISSING" ]; then echo "-Dmidpoint.repository.schemaVersionIfMissing=$REPO_SCHEMA_VERSION_IF_MISSING"; fi) \ | |
$(if [ -n "$REPO_SCHEMA_VARIANT" ]; then echo "-Dmidpoint.repository.schemaVariant=$REPO_SCHEMA_VARIANT"; fi) \ | |
-Dmidpoint.repository.initializationFailTimeout=60000 \ | |
-Dmidpoint.keystore.keyStorePassword_FILE=$MP_KEYSTORE_PASSWORD_FILE \ | |
-Dmidpoint.logging.alt.enabled=true \ | |
-Dmidpoint.logging.alt.filename=/tmp/logmidpoint \ | |
-Dspring.profiles.active="`$MP_DIR/active-spring-profiles`" \ | |
-Dserver.tomcat.ajp.enabled=$AJP_ENABLED \ | |
-Dserver.tomcat.ajp.port=$AJP_PORT \ | |
-Dserver.tomcat.ajp.secret=s3cr3t \ | |
-Dlogging.path=/tmp/logtomcat \ | |
-cp $MP_DIR/lib/midpoint.war \ | |
-Dloader.path="WEB-INF/classes,WEB-INF/lib,WEB-INF/lib-provided,$MP_DIR/var/lib" \ | |
org.springframework.boot.loader.PropertiesLauncher \ | |
$MP_JAVA_OPTS \ | |
-jar $MP_DIR/lib/midpoint.war &>/tmp/logmidpoint-console |