Skip to content

Commit

Permalink
Merge pull request #147 from delyriand/feature/add_es_url
Browse files Browse the repository at this point in the history
Add a new env variable to define the ES_URL
  • Loading branch information
maximehuran authored Nov 16, 2022
2 parents 4988cd6 + 21ead59 commit 21f616a
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 2 deletions.
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ setup_application:
(cd ${APP_DIR} && ${COMPOSER} install --no-interaction)
$(MAKE) apply_dist
(cd ${APP_DIR} && ${COMPOSER} require --no-progress --no-interaction monsieurbiz/${PLUGIN_NAME}="*@dev")
git restore dist/docker-compose.override.yaml # Restore dist file to prevent modification by flex recipes (symfony/mailer)
rm -rf ${APP_DIR}/var/cache

${APP_DIR}/docker-compose.yaml:
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ Finally configure plugin in your .env file by adding these lines at the end :
MONSIEURBIZ_SEARCHPLUGIN_MESSENGER_TRANSPORT_DSN=doctrine://default
MONSIEURBIZ_SEARCHPLUGIN_ES_HOST=${ELASTICSEARCH_HOST:-localhost}
MONSIEURBIZ_SEARCHPLUGIN_ES_PORT=${ELASTICSEARCH_PORT:-9200}
MONSIEURBIZ_SEARCHPLUGIN_ES_URL=http://${MONSIEURBIZ_SEARCHPLUGIN_ES_HOST}:${MONSIEURBIZ_SEARCHPLUGIN_ES_PORT}/
###< MonsieurBizSearchPlugin ###
```

Expand Down
1 change: 1 addition & 0 deletions dist/.env.local
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
MONSIEURBIZ_SEARCHPLUGIN_MESSENGER_TRANSPORT_DSN=doctrine://default
MONSIEURBIZ_SEARCHPLUGIN_ES_HOST=${ELASTICSEARCH_HOST:-localhost}
MONSIEURBIZ_SEARCHPLUGIN_ES_PORT=${ELASTICSEARCH_PORT:-9200}
MONSIEURBIZ_SEARCHPLUGIN_ES_URL=http://${MONSIEURBIZ_SEARCHPLUGIN_ES_HOST}:${MONSIEURBIZ_SEARCHPLUGIN_ES_PORT}/
1 change: 1 addition & 0 deletions recipes/2.0/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"env": {
"MONSIEURBIZ_SEARCHPLUGIN_ES_HOST": "${ELASTICSEARCH_HOST:-localhost}",
"MONSIEURBIZ_SEARCHPLUGIN_ES_PORT": "${ELASTICSEARCH_PORT:-9200}",
"MONSIEURBIZ_SEARCHPLUGIN_ES_URL": "http://${MONSIEURBIZ_SEARCHPLUGIN_ES_HOST}:${MONSIEURBIZ_SEARCHPLUGIN_ES_PORT}/",
"MONSIEURBIZ_SEARCHPLUGIN_MESSENGER_TRANSPORT_DSN": "doctrine://default"
}
}
7 changes: 5 additions & 2 deletions src/Resources/config/services.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
parameters:
monsieurbiz.search.elasticsearch.host: '%env(default::MONSIEURBIZ_SEARCHPLUGIN_ES_HOST)%'
monsieurbiz.search.elasticsearch.port: '%env(default::MONSIEURBIZ_SEARCHPLUGIN_ES_PORT)%'
monsieurbiz.search.elasticsearch.fallback_url: 'http://%monsieurbiz.search.elasticsearch.host%:%monsieurbiz.search.elasticsearch.port%/'
monsieurbiz.search.elasticsearch.url: '%env(default:monsieurbiz.search.elasticsearch.fallback_url:MONSIEURBIZ_SEARCHPLUGIN_ES_URL)%'
monsieurbiz.search.model.documentable.interface: MonsieurBiz\SyliusSearchPlugin\Model\Documentable\DocumentableInterface
monsieurbiz.search.request.interface: MonsieurBiz\SyliusSearchPlugin\Search\Request\RequestInterface
monsieurbiz.search.product_attribute_analyzer: 'search_standard'
Expand Down Expand Up @@ -45,8 +49,7 @@ services:
MonsieurBiz\SyliusSearchPlugin\Search\ClientFactory:
arguments:
$config:
host: '%env(MONSIEURBIZ_SEARCHPLUGIN_ES_HOST)%'
port: '%env(MONSIEURBIZ_SEARCHPLUGIN_ES_PORT)%'
url: '%monsieurbiz.search.elasticsearch.url%'

MonsieurBiz\SyliusSearchPlugin\Repository\ProductAttributeRepository:
arguments:
Expand Down

0 comments on commit 21f616a

Please sign in to comment.