You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Make container-like deployments easier by reading props from sys.env, we want to avoid rewriting the props file and repacking the war file like this: chrisjsimpson/obp-kubernetes#2 (comment) (<< this is to be avoided)
For docker-like environments, it is helpful instead to read runtime settings from the operating system environment vars, because we can inject these at container runtime.
def getPropsValue(nameOfProperty: String): Box[String] = {
# Replace "." with "_" (environment vars cannot include ".")
brandSpecificPropertyName = brandSpecificPropertyName.replace('.', '_')
# Convert to upper case
brandSpecificPropertyName = brandSpecificPropertyName.toUpperCase()
if (sys.env.get(brandSpecificPropertyName)) {
} else {
..... load from props file as normal
}
}
Gotcha
Environment variables will be upper case (s.toUpperCase())
Environment variables cannot contain a dot ("."), therefore:
oauth_1.hostname becomes OAUTH_1_HOSTNAME
api_hostname becomes API_HOSTNAME
The text was updated successfully, but these errors were encountered:
hongwei1
added a commit
to hongwei1/API-Explorer
that referenced
this issue
Feb 14, 2019
…low props values to be set via environment variables, falling back to props file,
includes logging to info logger which show from where the setting is being loaded (system environment or props file).
ResolvesOpenBankProject#59
Objective:
(The same as OBP API OpenBankProject/OBP-API#1208 )
Make container-like deployments easier by reading props from
sys.env
, we want to avoid rewriting the props file and repacking the war file like this: chrisjsimpson/obp-kubernetes#2 (comment) (<< this is to be avoided)For docker-like environments, it is helpful instead to read runtime settings from the operating system environment vars, because we can inject these at container runtime.
pseudo Logic
sys.env
) https://www.scala-lang.org/api/2.9.3/scala/sys/package.htmlpseudo code
Gotcha
s.toUpperCase()
).
"), therefore:oauth_1.hostname
becomesOAUTH_1_HOSTNAME
api_hostname
becomesAPI_HOSTNAME
The text was updated successfully, but these errors were encountered: