mirror of
https://github.com/spring-projects/spring-boot.git
synced 2024-08-29 03:06:45 +08:00
Document and test array support for spring.profiles.*
Closes gh-7175 Closes gh-6995
This commit is contained in:
parent
919d0c6172
commit
f64d5303cf
@ -128,8 +128,8 @@ content into your application; rather pick only the properties that you need.
|
||||
spring.pid.file= # Location of the PID file to write (if ApplicationPidFileWriter is used).
|
||||
|
||||
# PROFILES
|
||||
spring.profiles.active= # Comma-separated list of <<howto-set-active-spring-profiles,active profiles>>.
|
||||
spring.profiles.include= # Unconditionally activate the specified comma separated profiles.
|
||||
spring.profiles.active= # Comma-separated list (or list if using YAML) of <<howto-set-active-spring-profiles,active profiles>>.
|
||||
spring.profiles.include= # Unconditionally activate the specified comma separated profiles (or list of profiles if using YAML).
|
||||
|
||||
# SENDGRID ({sc-spring-boot-autoconfigure}/sendgrid/SendGridAutoConfiguration.{sc-ext}[SendGridAutoConfiguration])
|
||||
spring.sendgrid.api-key= # SendGrid api key (alternative to username/password)
|
||||
|
@ -1173,7 +1173,9 @@ For example, when an application with following properties is run using the swit
|
||||
my.property: fromyamlfile
|
||||
---
|
||||
spring.profiles: prod
|
||||
spring.profiles.include: proddb,prodmq
|
||||
spring.profiles.include:
|
||||
- proddb
|
||||
- prodmq
|
||||
----
|
||||
|
||||
NOTE: Remember that the `spring.profiles` property can be defined in a YAML document
|
||||
|
@ -536,6 +536,14 @@ public class ConfigFileApplicationListenerTests {
|
||||
"healthcheck");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void yamlSetsMultiProfilesWhenListProvided() throws Exception {
|
||||
this.initializer.setSearchNames("testsetmultiprofileslist");
|
||||
this.initializer.postProcessEnvironment(this.environment, this.application);
|
||||
assertThat(this.environment.getActiveProfiles()).containsExactly("dev",
|
||||
"healthcheck");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void yamlSetsMultiProfilesWithWhitespace() throws Exception {
|
||||
this.initializer.setSearchNames("testsetmultiprofileswhitespace");
|
||||
|
@ -0,0 +1,6 @@
|
||||
---
|
||||
spring:
|
||||
profiles:
|
||||
active:
|
||||
- dev
|
||||
- healthcheck
|
Loading…
Reference in New Issue
Block a user