enot icon indicating copy to clipboard operation
enot copied to clipboard

Specify multiple configuration variables

Open Ryanauger95 opened this issue 6 years ago • 2 comments

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!

Ryanauger95 avatar Jun 12 '18 14:06 Ryanauger95

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) 

comtihon avatar Jun 12 '18 14:06 comtihon

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

Ryanauger95 avatar Jun 25 '18 13:06 Ryanauger95