We should use Spring Profiles to load different properties for different environments, e.g development and production.
Currently we have a application.production.properties that is used in ElasticBeanstalk by setting the environment variable spring.config.name=application.production. Instead, we could set spring.profiles.active=production which would automatically use a file called application-production.properties; almost the same, but using the profiles concept (and notice the - instead of .)
We could also use spring.profiles.include=production to have common properties in one file, and include the properties appropriate for each environment.
In practice:
Configure application.properties to only have common properties
Configure application-production.properties to have common production things
Configure application-mysql.properties to have an example of mysql setup
3.1 Update docs chapter about mysql to use this - preferable tell how to configure tomcat also
Configure application-beanstalk.properties for mysql on EB
4.1 Update docs for "going to production", spring.profiles.include=production,beanstalk
Note: this needs verification, but if this is how it works - super!
We should use Spring Profiles to load different properties for different environments, e.g development and production.
Currently we have a
application.production.properties
that is used in ElasticBeanstalk by setting the environment variablespring.config.name=application.production
. Instead, we could setspring.profiles.active=production
which would automatically use a file calledapplication-production.properties
; almost the same, but using the profiles concept (and notice the - instead of .) We could also usespring.profiles.include=production
to have common properties in one file, and include the properties appropriate for each environment.In practice:
spring.profiles.include=production,beanstalk
Note: this needs verification, but if this is how it works - super!
Relevant docs: