mirror of
https://github.com/bitnami/containers.git
synced 2026-04-02 07:18:06 +08:00
23 lines
994 B
Bash
Executable File
23 lines
994 B
Bash
Executable File
#!/bin/bash
|
|
set -e
|
|
|
|
if [[ "$1" == "harpoon" && "$2" == "start" ]]; then
|
|
status=`harpoon inspect $BITNAMI_APP_NAME`
|
|
if [[ "$status" == *'"lifecycle": "unpacked"'* ]]; then
|
|
harpoon initialize $BITNAMI_APP_NAME \
|
|
${MONGODB_ROOT_PASSWORD:+--rootPassword $MONGODB_ROOT_PASSWORD} \
|
|
${MONGODB_USER:+--username $MONGODB_USER} \
|
|
${MONGODB_PASSWORD:+--password $MONGODB_PASSWORD} \
|
|
${MONGODB_DATABASE:+--database $MONGODB_DATABASE} \
|
|
${MONGODB_REPLICASET_MODE:+--replicaSetMode $MONGODB_REPLICASET_MODE} \
|
|
${MONGODB_REPLICASET_NAME:+--replicaSetName $MONGODB_REPLICASET_NAME} \
|
|
${MONGODB_PRIMARY_HOST:+--primaryHost $MONGODB_PRIMARY_HOST} \
|
|
${MONGODB_PRIMARY_PORT:+--primaryPort $MONGODB_PRIMARY_PORT} \
|
|
${MONGODB_PRIMARY_USER:+--primaryUser $MONGODB_PRIMARY_USER} \
|
|
${MONGODB_PRIMARY_PASSWORD:+--primaryPassword $MONGODB_PRIMARY_PASSWORD}
|
|
fi
|
|
chown $BITNAMI_APP_USER: /bitnami/$BITNAMI_APP_NAME || true
|
|
fi
|
|
|
|
exec /entrypoint.sh "$@"
|