Skip to content
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

Mapbox data as environment config #624

Open
manumoreira opened this issue Apr 9, 2021 · 0 comments
Open

Mapbox data as environment config #624

manumoreira opened this issue Apr 9, 2021 · 0 comments

Comments

@manumoreira
Copy link

Small suggestion, maybe not worth the effort: it'd be ideal if these values came from the environment configuration. The mechanism we have right now is:

define the variables in the application configuration with values from the environment, as in https://github.com/instedd/planwise/blob/master/resources/planwise/config.edn#L157 or https://github.com/instedd/planwise/blob/master/resources/planwise/config.edn#L99
add the values to the rendered client configuration in the home endpoint, by extracting the values from the Duct configuration map (eg. https://github.com/instedd/planwise/blob/master/src/planwise/endpoint/home.clj#L34). This will result in the values being rendered in the global JS variables _CONFIG
implement a couple of vars in the client's config namespace: https://github.com/instedd/planwise/blob/master/client/src/planwise/client/config.cljs#L14
use the vars from such namespace, as in https://github.com/instedd/planwise/blob/master/client/src/planwise/client/design/views.cljs#L139
This way we can define the map ID and access tokens as environment variables in the deployments and if they change we don't need to rebuild the Docker image.

Suggestions copied from #614 review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant