i have modified boss_plugin.erl and boss_rebar.erl so one can use ./rebar boss c=start_dev_cmd config="some.config"|grep -v "==>" in init.sh script and add as many shortcuts as reguired
if no config param is set, then boss.config is used
in order boss_rebar:run\5 to work properly with command line config param u
need to add extra line in alternative configs, for example, if alternative
is boss.test.config and boss was initiated with ./rebar boss
c=start_dev_cmd config="boss.test.config"
{this_config, "boss.test.config"}, %if absent boss.config will be used
{use_config, "boss.test-2.config"}, %use instead of this_config file
so u can make ./rebar boss c=start_dev_cmd config="env-1.config"|grep -v
"==>" in init.sh script
and then add {use_config, "env-2.config"}, in env-1.config , eventually
env-2.config will be used.
what i posted before works the same, i.e. if u do not set config param in
comand line, boss.config will be used as default and u can set alternative
envs with {use_config, CONF_NAME}, no need to specify {this_config,
CONF_NAME} in this case,
if both this_config and use_config are absent boss.config will be used.
On Saturday, May 31, 2014 7:30:24 AM UTC+4, can2nac wrote:
>
> this can be done with additional rebar params, example, ./rebar boss
> c=start_dev_cmd config="boss.test-2.config"
> you need to modify PROJECT/priv/rebar/boss_plugin.erl to make this works
>
> On Friday, May 30, 2014 8:55:25 PM UTC+4, Evgeny M wrote:
>>
>> At the moment I just use another boss.config file for production, named
>> boss.config.rel - my build script copies it over development one into the
>> build directory from which .deb, .rpm and .tar.gz packages are generated by
>> the same script.
>>
>> It would be nice to have something like boss.config and boss.config.dev -
>> .dev should be loaded automatically with init-dev.sh (or load boss.config
>> if boss.config.dev does not exist), init.sh should load boss.config. Having
>> just one file with ifs' would be impractical when the app is getting
>> packaged into a package such as .deb - in this case boss.config file is
>> usually marked as 'config file', this prevents blind overwriting of it by a
>> package manager in case when user did any modifications to the old config
>> file. When developer makes changes to this file (and developers do this
>> often), even in developer 'if' branch, package manager sees this file as
>> modified (a new branch of this file) and will show an unnecessary prompt
>> to the user - what to do with the changed config file. Imo having two
>> separate config files would be fine and easier to implement.
>>
>> пятница, 30 мая 2014 г., 15:09:14 UTC+4 пользователь David Welton написал:
>>>
>>> I asked this on the Erlang list:
>>>
>>> http://erlang.org/pipermail/erlang-questions/2014-May/079310.html
>>>
>>> The ideal thing would really be to have a common config file, with
>>> perhaps some kind of if/else for small differences. Or auxiliary
>>> files for dev and production that contain additional configuration for
>>> those.
>>>
>>> Thoughts?
>>> --
>>> David N. Welton
>>>
>>> http://www.welton.it/davidw/
>>>
>>> http://www.dedasys.com/
>>>
>>
--
You received this message because you are subscribed to the Google Groups
"ChicagoBoss" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
Visit this group at http://groups.google.com/group/chicagoboss.
To view this discussion on the web visit
https://groups.google.com/d/msgid/chicagoboss/4b368211-acd5-43ae-a56b-918132435dc5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
boss_plugin.erl
Description: Binary data
boss_rebar.erl
Description: Binary data
