hi guys i need to set based on a profile a environ...
# spring
d
hi guys i need to set based on a profile a environment variable (here https_proxy) for local development. any best practise for it ? (my idea so far is to set it within a @Configuration in the init block with ProcessBuilder, but no luck so far 😞 )
t
if you only need it for local development and not for production, I suggest just customizing your run configuration and setting the environmelt variable from outside.
d
hi tobias, yeah sure we only need it for local development. can i "pin" https_proxy within application yaml on a specific profile ?
t
if you can set it it your application yaml you can just add a profile specific configuration. E.g. you can add a file called
application-local-proxy.yml
and configure your profile there. Now whenever the profile
local-proxy
is active, that config will be loaded (in addition to the default config file)
d
my profile is called "remote" so i am calling it application-remote.yaml. (it need exactly this syntax i guess ? )
t
yes, it's just
application-<profile>.yml
🙌 1
file type doesn't matter of course.
and just a hint that people often forget: you can use mutliple profiles simutlaneously.
d
yeah thx we are doing this all the time
i was not aware of this application-<profile> really nice hint
so i ve set within application-remote a variable called proxy: ${HTTPS_PROXY:url}
hmm does not work 😞