Skip to content

Add MercureBundle recipe #477

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
2 commits merged into from
Nov 30, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions symfony/mercure-bundle/0.1/config/packages/mercure.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
mercure:
hubs:
default:
url: '%env(MERCURE_PUBLISH_URL)%'
jwt: '%env(MERCURE_JWT_SECRET)%'
17 changes: 17 additions & 0 deletions symfony/mercure-bundle/0.1/manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"bundles": {
"Symfony\\Bundle\\MercureBundle\\MercureBundle": ["all"]
},
"copy-from-recipe": {
"config/": "%CONFIG_DIR%/"
},
"container": {
"env(MERCURE_PUBLISH_URL)": "",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why add them as defaults in the container when you have them set up in env? 🤔

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To prevent an error when env var are not defined (when building a Docker container for instance).

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can instead define the env(MERCURE_PUBLISH_URL) parameter in the bundle.

Copy link
Member Author

@dunglas dunglas Oct 27, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It’s not the bundle’s responsibility: you may use it without env vars.
Also, the user may choose to use other names of env vars.

"env(MERCURE_JWT_SECRET)": ""
},
"env": {
"MERCURE_PUBLISH_URL": "https://demo.mercure.rocks/hub",
"MERCURE_JWT_SECRET": "#see https://mercure.rocks"
},
"aliases": ["mercure"]
}