Feature/replace os vars test#527
Conversation
938a6fb to
3595929
Compare
| # the result is saved to vm.args | ||
| awk '{while(match($0,"[$]{[^}]*}")) {var=substr($0,RSTART+2,RLENGTH -3);gsub("[$]{"var"}",ENVIRON[var])}}1' < "$orig_vmargs_path" > "$VMARGS_PATH" | ||
| fi | ||
|
|
There was a problem hiding this comment.
What will happen if you run the second time without RELX_REPLACE_OS_VARS? Would you want to run it from modified vm.args or original vm.args?
There was a problem hiding this comment.
yeah, i had some doubts about this behaviour, i ended up going with run from modified vm.args, the reason being that the original probably has env variables that won't get replaced and most likely will cause the release start to fail, what are your thoughts?
There was a problem hiding this comment.
Would it be simpler if we just maintain the following invariant:
if RELX_REPLACE_OS_VARS then modify else use original.
irrespective of whether it is first, second .... run
There was a problem hiding this comment.
ok, i think that was the previous behaviour, let's keep that way then.
I've updated the PR with that change and the tests, please check it when time is available
3595929 to
18cf500
Compare
ca620fe to
d3ac144
Compare
d3ac144 to
11d22ee
Compare
|
@tsloughter any comments on this? if not i'll go ahead and merge it to get common ground for the other pending PRs related with this functionality |
|
This also cleans up the init script a little bit, which is nice. 👍 |
The first run would correctly replace the environment variables, however it would also overwrite the original vm.args and sys.config thus preventing any further substitution in subsequent runs. Dev mode runs were also broken, all runs after the first were required to also define the RELX_REPLACE_OS_VARS variable in order not to overwrite the current vm.args with the original one, this prevented simply attaching to an already running node that was started this way. Add tests to exercise this functionality.
11d22ee to
f0e0d1a
Compare
The first run would correctly replace the environment variables, however it would also overwrite the original vm.args and sys.config thus preventing any further substitution in subsequent runs. Dev mode runs were also broken, all runs after the first were required to also define the RELX_REPLACE_OS_VARS variable in order not to overwrite the current vm.args with the original one,
this prevented simply attaching to an already running node that was started this way.
This involved reverting part of #441 mostly to simplify the logic
which is now: sys.config and vm.args are created both in dev and normal mode, if os vars replace is requested then a copy of these files is made once and kept in sys.config.orig and vm.args.orig, subsequent runs use these original files to continue performing the variable substitution. If a run is made without the RELX_REPLACE_OS_VARS set any existent .orig files are renamed to their original names.