Skip to content

Commit

Permalink
Merge pull request #1023 from Jorengarenar/develop
Browse files Browse the repository at this point in the history
Enable environment variables in config.yml
  • Loading branch information
Athou authored Jan 4, 2023
2 parents e44ea5b + b2b608e commit 7ea24b2
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@

import io.dropwizard.Application;
import io.dropwizard.assets.AssetsBundle;
import io.dropwizard.configuration.EnvironmentVariableSubstitutor;
import io.dropwizard.configuration.SubstitutingSourceProvider;
import io.dropwizard.db.DataSourceFactory;
import io.dropwizard.forms.MultiPartBundle;
import io.dropwizard.hibernate.HibernateBundle;
Expand Down Expand Up @@ -117,6 +119,10 @@ public DataSourceFactory getDataSourceFactory(CommaFeedConfiguration configurati

bootstrap.addBundle(new AssetsBundle("/assets/", "/", "index.html"));
bootstrap.addBundle(new MultiPartBundle());

// Enable variable substitution with environment variables
bootstrap.setConfigurationSourceProvider(
new SubstitutingSourceProvider(bootstrap.getConfigurationSourceProvider(), new EnvironmentVariableSubstitutor(false)));
}

@Override
Expand Down

0 comments on commit 7ea24b2

Please sign in to comment.