Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F65475478
docker-entrypoint.sh
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Tue, Jun 4, 01:40
Size
1 KB
Mime Type
text/x-shellscript
Expires
Thu, Jun 6, 01:40 (2 d)
Engine
blob
Format
Raw Data
Handle
18078396
Attached To
R4444 MedCo Deployment
docker-entrypoint.sh
View Options
#!/usr/bin/env bash
set -Eeuo pipefail
# wait for postgres to be available
export PGPASSWORD="$I2B2_DB_PW"
export PSQL_PARAMS="-v ON_ERROR_STOP=1 -h ${I2B2_DB_HOST} -p ${I2B2_DB_PORT} -U ${I2B2_DB_USER}"
until psql $PSQL_PARAMS -d postgres -c '\q'; do
>&2 echo "Waiting for postgresql..."
sleep 1
done
# load initial data if database does not exist (credentials must be valid and have create database right)
DB_CHECK=`psql $PSQL_PARAMS -d postgres -X -A -t -c "select count(*) from pg_database where datname = '${I2B2_DB_NAME}';"`
if [ "$DB_CHECK" -ne "1" ]; then
echo "Initialising i2b2 database"
psql $PSQL_PARAMS -d postgres <<-EOSQL
CREATE DATABASE ${I2B2_DB_NAME};
EOSQL
# get the i2b2 data
pushd "$I2B2_DATA_DIR"
git clone --depth 1 --branch $I2B2_DATA_VERSION https://github.com/i2b2/i2b2-data.git .
popd
# run loading scripts
for f in "$I2B2_SQL_DIR"/*.sh; do
bash "$f"
done
fi
# execute pre-init scripts & run wildfly
for f in "$PRE_INIT_SCRIPT_DIR"/*.sh; do
bash "$f"
done
exec /opt/jboss/wildfly/bin/standalone.sh -b 0.0.0.0 -bmanagement 0.0.0.0
Event Timeline
Log In to Comment