mirror of
https://github.com/bitnami/containers.git
synced 2026-03-19 15:57:46 +08:00
perform mariadb/mongodb module installation only with generated code
This commit is contained in:
@@ -52,7 +52,7 @@ wait_for_db() {
|
||||
fi
|
||||
}
|
||||
|
||||
setup_db() {
|
||||
add_database_support() {
|
||||
if getent hosts mongodb >/dev/null && ! npm ls mongodb >/dev/null; then
|
||||
npm install --save mongodb
|
||||
fi
|
||||
@@ -67,10 +67,18 @@ log () {
|
||||
}
|
||||
|
||||
if [ "$1" == npm -a "$2" == "start" ]; then
|
||||
if database_tier_exists; then
|
||||
wait_for_db
|
||||
fi
|
||||
|
||||
if ! app_present; then
|
||||
log "Creating express application"
|
||||
express . -f
|
||||
|
||||
if database_tier_exists; then
|
||||
add_database_support
|
||||
fi
|
||||
|
||||
log "Adding dist samples"
|
||||
cp -r /dist/samples .
|
||||
fi
|
||||
@@ -81,10 +89,6 @@ if [ "$1" == npm -a "$2" == "start" ]; then
|
||||
log "Dependencies updated"
|
||||
fi
|
||||
|
||||
if database_tier_exists; then
|
||||
wait_for_db
|
||||
fi
|
||||
|
||||
if ! fresh_container; then
|
||||
echo "#########################################################################"
|
||||
echo " "
|
||||
@@ -95,9 +99,7 @@ if [ "$1" == npm -a "$2" == "start" ]; then
|
||||
echo " "
|
||||
echo "#########################################################################"
|
||||
else
|
||||
if database_tier_exists; then
|
||||
setup_db
|
||||
fi
|
||||
# Perform any app initialization tasks here.
|
||||
log "Initialization finished"
|
||||
fi
|
||||
|
||||
|
||||
Reference in New Issue
Block a user