Use central config for env vars

This commit is contained in:
Jose Diaz-Gonzalez
2015-08-29 01:54:00 -04:00
parent f6b98c1066
commit 653bb8828b
5 changed files with 7 additions and 25 deletions

View File

@@ -1,8 +1,6 @@
#!/usr/bin/env bash
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
PLUGIN_DATA_ROOT=/var/lib/dokku/services/mongo
PLUGIN_SERVICE="MongoDB"
source "$(dirname "$0")/config"
get_random_port() {
local port=$RANDOM
@@ -38,7 +36,7 @@ service_alias() {
if [[ -f "$ALIAS_FILE" ]]; then
cat "$ALIAS_FILE"
else
echo "MONGO"
echo "$PLUGIN_DEFAULT_ALIAS"
fi
}
@@ -49,5 +47,5 @@ service_url() {
local ID="$(cat "$SERVICE_ROOT/ID")"
local IP="$(get_container_ip "$ID")"
echo "mongodb://$IP:27017"
echo "$PLUGIN_SCHEME://$IP:$PLUGIN_DATASTORE_PORT"
}