From fd32f7d26a6861997c8185daa23409c387487123 Mon Sep 17 00:00:00 2001 From: Alessandro Lai Date: Fri, 19 Jan 2018 22:32:52 +0100 Subject: [PATCH 1/4] Create basic recipe for the MongoDB Bundle --- .../0.6/config/packages/facile-it_mongodb.yaml | 17 +++++++++++++++++ facile-it/mongodb-bundle/0.6/manifest.json | 15 +++++++++++++++ 2 files changed, 32 insertions(+) create mode 100644 facile-it/mongodb-bundle/0.6/config/packages/facile-it_mongodb.yaml create mode 100644 facile-it/mongodb-bundle/0.6/manifest.json diff --git a/facile-it/mongodb-bundle/0.6/config/packages/facile-it_mongodb.yaml b/facile-it/mongodb-bundle/0.6/config/packages/facile-it_mongodb.yaml new file mode 100644 index 00000000..f9b0ac19 --- /dev/null +++ b/facile-it/mongodb-bundle/0.6/config/packages/facile-it_mongodb.yaml @@ -0,0 +1,17 @@ +mongo_db_bundle: + data_collection: '%kernel.debug%' + clients: + default: + hosts: + - { host: '%env(MONGODB_HOST)%', port: '%env(MONGODB_PORT)%' } + username: '%env(MONGODB_USER)%' + password: '%env(MONGODB_PASSWORD)%' + replicaSet: '' # default null (no replica) + ssl: false + connectTimeoutMS: 3000 + readPreference: primaryPreferred # see https://docs.mongodb.com/manual/reference/read-preference/#primary for info + + connections: + default: + client_name: default + database_name: '%env(MONGODB_DB)%' diff --git a/facile-it/mongodb-bundle/0.6/manifest.json b/facile-it/mongodb-bundle/0.6/manifest.json new file mode 100644 index 00000000..26c702cc --- /dev/null +++ b/facile-it/mongodb-bundle/0.6/manifest.json @@ -0,0 +1,15 @@ +{ + "bundles": { + "Facile\\MongoDbBundle\\FacileMongoDbBundle": ["all"] + }, + "copy-from-recipe": { + "config/": "%CONFIG_DIR%/", + }, + "env": { + "MONGODB_HOST": "localhost", + "MONGODB_PORT": "27017", + "MONGODB_USER": null, + "MONGODB_PASSWORD": null, + "MONGODB_DB": "symfony" + } +} From 130f8198ed2f3b4f0667febeca64bd490f3d335a Mon Sep 17 00:00:00 2001 From: Alessandro Lai Date: Fri, 19 Jan 2018 22:53:31 +0100 Subject: [PATCH 2/4] Fix JSON syntax --- facile-it/mongodb-bundle/0.6/manifest.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/facile-it/mongodb-bundle/0.6/manifest.json b/facile-it/mongodb-bundle/0.6/manifest.json index 26c702cc..fceade21 100644 --- a/facile-it/mongodb-bundle/0.6/manifest.json +++ b/facile-it/mongodb-bundle/0.6/manifest.json @@ -3,7 +3,7 @@ "Facile\\MongoDbBundle\\FacileMongoDbBundle": ["all"] }, "copy-from-recipe": { - "config/": "%CONFIG_DIR%/", + "config/": "%CONFIG_DIR%/" }, "env": { "MONGODB_HOST": "localhost", From 7595f076fd5090c29fb7f3a644c492d81e0fa93b Mon Sep 17 00:00:00 2001 From: Alessandro Lai Date: Fri, 19 Jan 2018 23:00:41 +0100 Subject: [PATCH 3/4] Comply to env string format and config file naming --- .../{facile-it_mongodb.yaml => facile_it_mongodb.yaml} | 0 facile-it/mongodb-bundle/0.6/manifest.json | 4 ++-- 2 files changed, 2 insertions(+), 2 deletions(-) rename facile-it/mongodb-bundle/0.6/config/packages/{facile-it_mongodb.yaml => facile_it_mongodb.yaml} (100%) diff --git a/facile-it/mongodb-bundle/0.6/config/packages/facile-it_mongodb.yaml b/facile-it/mongodb-bundle/0.6/config/packages/facile_it_mongodb.yaml similarity index 100% rename from facile-it/mongodb-bundle/0.6/config/packages/facile-it_mongodb.yaml rename to facile-it/mongodb-bundle/0.6/config/packages/facile_it_mongodb.yaml diff --git a/facile-it/mongodb-bundle/0.6/manifest.json b/facile-it/mongodb-bundle/0.6/manifest.json index fceade21..ecc5f8ae 100644 --- a/facile-it/mongodb-bundle/0.6/manifest.json +++ b/facile-it/mongodb-bundle/0.6/manifest.json @@ -8,8 +8,8 @@ "env": { "MONGODB_HOST": "localhost", "MONGODB_PORT": "27017", - "MONGODB_USER": null, - "MONGODB_PASSWORD": null, + "MONGODB_USER": "", + "MONGODB_PASSWORD": "", "MONGODB_DB": "symfony" } } From 66437a508e8fae93c293e051af859c95ef94d1e7 Mon Sep 17 00:00:00 2001 From: Alessandro Lai Date: Sun, 21 Jan 2018 14:21:42 +0100 Subject: [PATCH 4/4] Fix env variable interpolation --- .../mongodb-bundle/0.6/config/packages/facile_it_mongodb.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/facile-it/mongodb-bundle/0.6/config/packages/facile_it_mongodb.yaml b/facile-it/mongodb-bundle/0.6/config/packages/facile_it_mongodb.yaml index f9b0ac19..377988b9 100644 --- a/facile-it/mongodb-bundle/0.6/config/packages/facile_it_mongodb.yaml +++ b/facile-it/mongodb-bundle/0.6/config/packages/facile_it_mongodb.yaml @@ -3,7 +3,7 @@ mongo_db_bundle: clients: default: hosts: - - { host: '%env(MONGODB_HOST)%', port: '%env(MONGODB_PORT)%' } + - { host: '%env(MONGODB_HOST)%', port: '%env(int:MONGODB_PORT)%' } username: '%env(MONGODB_USER)%' password: '%env(MONGODB_PASSWORD)%' replicaSet: '' # default null (no replica)