Issue
I tried using env variables in my application.yml configration like:
spring:
main:
show_banner: false
---
spring:
profiles: production
server:
address: $OPENSHIFT_DIY_IP
port: $OPENSHIFT_DIY_PORT
but the env variables are not resolved. Do I have to provide a different notation?
In Rails you can e.g. use <%= ENV['FOOVAR'] %>
The only alternative is to run the app like:
java -jar my.jar --server.address=$OPENSHIFT_DIY_IP --server.port=$OPENSHIFT_DIY_PORT
Solution
Try ${OPENSHIFT_DIY_PORT}
(the usual Spring placeholder notation). See here for docs.
Answered By - Dave Syer
Answer Checked By - Pedro (JavaFixing Volunteer)