This is an automated email from the ASF dual-hosted git repository.

tianxiaoliang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/servicecomb-kie.git


The following commit(s) were added to refs/heads/master by this push:
     new ff39c38  Support connect to non-auth mongo server (#179)
ff39c38 is described below

commit ff39c38a051ff885fa387419e9bfb38dd747944b
Author: little-cui <[email protected]>
AuthorDate: Thu Apr 15 19:44:13 2021 +0800

    Support connect to non-auth mongo server (#179)
---
 scripts/start.sh | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/scripts/start.sh b/scripts/start.sh
index 59571ef..0b390bf 100755
--- a/scripts/start.sh
+++ b/scripts/start.sh
@@ -56,9 +56,15 @@ logRotateSize: 10
 
 logBackupCount: 7
 EOM
+
+local uri="mongodb://${MONGODB_ADDR}/kie"
+if [ -n "${MONGODB_USER}" ]; then
+  uri="mongodb://${MONGODB_USER}:${MONGODB_PWD}@${MONGODB_ADDR}/kie"
+fi
+
 cat <<EOM > /etc/servicecomb-kie/kie-conf.yaml
 db:
-  uri: mongodb://${MONGODB_USER}:${MONGODB_PWD}@${MONGODB_ADDR}/kie
+  uri: ${uri}
   type: mongodb
   poolSize: 10
   ssl: false

Reply via email to