Open knocknarea opened 6 years ago
You are correct that environment variables added during run are not currently persisted for subsequent runs. The scenario that you describe does make sense though. Until we come up with a solution for this, your best workaround for passing the Spring profile is probably to use the system property as described here: https://boxfuse.com/docs/payloads/springboot#profiles
Make sure to include those JVM args when fusing the image. This way they will be baked into the image and the scaling scenario you described will work out of the box without issues.
Ok I'll try that. Thanks for the help @axelfontaine
As part of our automated build process we fuse and then run out spring boot image with an additional command line environment variable via
We let boxfuse look after the database configuration but supply an additional spring profile for services that the application connects to based on different deployment scenarios
It all works fine in the build and deploy stage.
If I want to subsequently scale the application I can go to the boxfuse console, however...
If I scale the node there, what actually gets executed (the additional node that is spun up) does not have the envvars set as the initial node that was created when the application was run via the command line.
This means that the scaled nodes are not properly configured for the environment they are executing in.
Why is this? Surely when I run boxfuse in a particular environment, it should remember what the configuration for the images is (in that environment)
The deployment script looks like this:
The key element here is the $SPRING_OPT value is not preserved so that it is acted on when using the console.
Your advice on what to do would be much appreciated.