From 1b7d2c16eb3269086f6ad58e4742aa2bec1226cd Mon Sep 17 00:00:00 2001 From: Valentin Lab Date: Sat, 24 Oct 2020 17:06:09 +0200 Subject: [PATCH] fix: [gogocarto] properly set the database name in mongodb Signed-off-by: Valentin Lab --- gogocarto/README.org | 2 ++ gogocarto/hooks/mongo_database-relation-joined | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/gogocarto/README.org b/gogocarto/README.org index 18af7ea..a246a87 100644 --- a/gogocarto/README.org +++ b/gogocarto/README.org @@ -80,6 +80,8 @@ sed -ri "s/^(<\?php)/\1\n\ini_set('memory.limit', '1024M');/" \ web/index.php bin/console sed -ri "s%dirname\(__DIR__\)\.'%'/opt/apps/gogocarto%g" \ web/index.php +sed -ri "s/gogocarto_default/'%env(MONGODB_DATABASE)%_default'/g" \ + config/packages/doctrine_mongodb.yaml commit_sha=$(git describe HEAD --tags) tar cjv \ bin web vendor config src templates translations \ diff --git a/gogocarto/hooks/mongo_database-relation-joined b/gogocarto/hooks/mongo_database-relation-joined index 03e3172..b7b90e7 100755 --- a/gogocarto/hooks/mongo_database-relation-joined +++ b/gogocarto/hooks/mongo_database-relation-joined @@ -14,13 +14,14 @@ fi inited="${GOGOCARTO_CODE}"/.inited-${DBNAME} -MONGO_URL=mongodb://${TARGET_SERVICE_NAME}:27017/${DBNAME} +MONGO_URL=mongodb://${TARGET_SERVICE_NAME}:27017 cat <> ${GOGOCARTO_CODE}/.env ###> doctrine/mongodb-odm-bundle ### MONGODB_URL=$MONGO_URL +MONGODB_DATABASE=$DBNAME ###< doctrine/mongodb-odm-bundle ### EOF