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

Specify multiple configuration variables #60

Open
Ryanauger95 opened this issue Jun 12, 2018 · 2 comments
Open

Specify multiple configuration variables #60

Ryanauger95 opened this issue Jun 12, 2018 · 2 comments

Comments

@Ryanauger95
Copy link

Hello!

I can see in your example project, for the vm.args you have:

-name {{ app.name }}@127.0.0.1
-setcookie {{ app.name }}

Is there a way to specify other variables that we could use, such as {{ local_ip_addr }} ? Or is app.name the only variable? I assume the former, if you have any information please let me know!

@comtihon
Copy link
Owner

comtihon commented Jun 12, 2018

hi,
you can access hostname and erl from the predefined variables.
Also you can use system's environmental variables:
F.e. export MAGIC_GREETING="hello" and use it in sys.config, vm.args, relx.config or .app.src

{env, [
                {% if MAGIC_GREETING is defined %}
                  {greeting, "{{ MAGIC_GREETING }}"}
                {% else %}
                  {greeting, "hello world!" }
                {% endif %}
              ]}
```.
Please rever [here](https://github.com/comtihon/enot/blob/master/docs/templating.md) 

@Ryanauger95
Copy link
Author

Thanks! I didn't realize that you could add it to all of those files!

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

No branches or pull requests

2 participants