vaadin / bakery-app-starter-fw8-spring

Internal repository for Bakery App Starter for FW8 and Spring
Other
0 stars 2 forks source link

Use profiles for dev/production properties #430

Open emarc opened 7 years ago

emarc commented 7 years ago

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:

  1. Configure application.properties to only have common properties
  2. Configure application-production.properties to have common production things
  3. 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
  4. 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!

Relevant docs: