Yeps, that works, but I need something work like this. mix generate_config name(so I can generate a config before compiling start to update the current config) MIX_ENV=prod mix compile && MIX_ENV=prod mix release scp rel/target.tar.bz2 server/name if I do use db access in Config, I have no idea how argument can be sent into,so I end up with Macro which works good and easier to log with.
在 2016年8月1日星期一 UTC+8下午11:27:42,OvermindDL1写道: > > Technically the Mix.Config files are full code, you could access the > database within them and use values you get from there (I actually do a few > things kind of like that for certain environment things that I cannot get > from the environment). > > On Monday, August 1, 2016 at 9:21:02 AM UTC-6, Narcissus Emi wrote: >> >> most config items are from db, so is hard to generate from normal >> configuration, and they might change the way how code is being generated as >> well. >> I went back to use import_config in together with a mix task to create a >> config file by using Macro.to_string(quote bind_quotes: [value: value] do >> use Mix.Config >> config app, >> key: value >> end) before doing exrm release. >> >> 在 2016年8月1日星期一 UTC+8下午10:01:28,OvermindDL1写道: >>> >>> Large variety of ways of taking this. Where are the key/values coming >>> from and why can they not be put in a normal configuration file first? >>> >>> On Monday, August 1, 2016 at 4:21:22 AM UTC-6, Narcissus Emi wrote: >>>> >>>> Hi, >>>> >>>> I'm now running a project which needs to generate config file based on >>>> user configurable key/value pair, I would like to create a >>>> user.exs(imported from config.exs) to before recompile and deploy the file >>>> all programmatically,currently I'm stucked at creating this exs file part. >>>> >>>> Since a exs is just a valid keyword list, I think maybe using >>>> IO.inspect(keywords) and write to a file is already enough? Or is there >>>> any >>>> libs or methods we can do it more elegantly? >>>> >>>> Hope anybody came across similar problem before, any help would be real >>>> appreciate :) >>>> >>> -- You received this message because you are subscribed to the Google Groups "elixir-lang-talk" group. To unsubscribe from this group and stop receiving emails from it, send an email to elixir-lang-talk+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/elixir-lang-talk/ba17fce4-e8b6-4320-9361-06ed180889c4%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.