entrypoint: load the module inputs.json file

This commit is contained in:
Sameer Naik
2016-09-04 14:52:54 +05:30
parent 472d21345e
commit 49136ac354
2 changed files with 20 additions and 8 deletions

View File

@@ -1,16 +1,26 @@
#!/bin/bash
set -e
#!/bin/bash -e
function initialize {
# Package can be "installed" or "unpacked"
status=`nami inspect $1`
if [[ "$status" == *'"lifecycle": "unpacked"'* ]]; then
# Clean up inputs
inputs=""
if [[ -f /$1-inputs.json ]]; then
inputs=--inputs-file=/$1-inputs.json
fi
nami initialize $1 $inputs
fi
}
if [ -f composer.json ]; then
composer install
fi
if [[ "$1" == "nami" && "$2" == "start" ]]; then
status=`nami inspect php`
if [[ "$status" == *'"lifecycle": "unpacked"'* ]]; then
nami initialize php
fi
chown -R :$BITNAMI_APP_USER /bitnami/$BITNAMI_APP_NAME || true
if [[ "$1" == "nami" && "$2" == "start" ]] || [[ "$1" == "/init.sh" ]]; then
initialize php
chown -R :$BITNAMI_APP_USER /bitnami/php || true
echo "Starting application ..."
fi
exec /entrypoint.sh "$@"

View File

@@ -0,0 +1,2 @@
{
}