Skip to content

Commit 649b9f9

Browse files
author
Christopher Frost
committed
Improve documentation on setting config variables
This commit improves the documentation around using environment variables to set configuration values. This includes some new examples of how to set values from an applications manifest file. [#102675140]
1 parent 61f40cf commit 649b9f9

22 files changed

Lines changed: 39 additions & 25 deletions

README.md

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,19 +27,33 @@ The following are _very_ simple examples for deploying the artifact types that w
2727
## Configuration and Extension
2828
The buildpack supports extension through the use of Git repository forking. The easiest way to accomplish this is to use [GitHub's forking functionality][] to create a copy of this repository. Make the required extension changes in the copy of the repository. Then specify the URL of the new repository when pushing Cloud Foundry applications. If the modifications are generally applicable to the Cloud Foundry community, please submit a [pull request][] with the changes.
2929

30-
Buildpack configuration can be overridden with an environment variable matching the configuration file you wish to override minus the `.yml` extension and with a prefix of `JBP_CONFIG`. It is not possible to add new configuration properties and properties with `nil` or empty values will be ignored by the buildpack. The value of the variable should be valid inline yaml. For example, to change the default version of Java to 7 and adjust the memory heuristics apply this environment variable to the application.
30+
Buildpack configuration can be overridden with an environment variable matching the configuration file you wish to override minus the `.yml` extension and with a prefix of `JBP_CONFIG`. It is not possible to add new configuration properties and properties with `nil` or empty values will be ignored by the buildpack. The value of the variable should be valid inline yaml, referred to as `flow style` in the yaml spec. For example, to change the default version of Java to 7 and adjust the memory heuristics apply this environment variable to the application.
3131

3232
```bash
33-
$ cf set-env my-application JBP_CONFIG_OPEN_JDK_JRE 'jre: { version: 1.7.0_+ }'
33+
$ cf set-env my-application JBP_CONFIG_OPEN_JDK_JRE '[jre: { version: 1.7.0_+ }]'
3434
```
3535

3636
If the key or value contains a special character such as `:` it should be escaped with double quotes. For example, to change the default repository path for the buildpack.
3737

3838
```bash
39-
$ cf set-env my-application JBP_CONFIG_REPOSITORY 'default_repository_root: "http://repo.example.io"'
39+
$ cf set-env my-application JBP_CONFIG_REPOSITORY '[default_repository_root: "http://repo.example.io"]'
4040
```
4141

42-
Environment variable can also be specified in the applications `manifest` file. See the [Environment Variables][] documentation for more information.
42+
Environment variable can also be specified in the applications `manifest` file. For example, to specify an environment variable in an applications manifest file that disables Auto-reconfiguration.
43+
44+
```bash
45+
env:
46+
JBP_CONFIG_SPRING_AUTO_RECONFIGURATION: '[enabled: false]'
47+
```
48+
49+
This final example shows how to change the version of Tomcat that is used by the buildpack with an environment variable specified in the applications manifest file.
50+
51+
```bash
52+
env:
53+
JBP_CONFIG_TOMCAT: '[tomcat: { version: 8.0.+ }]'
54+
```
55+
56+
See the [Environment Variables][] documentation for more information.
4357

4458
To learn how to configure various properties of the buildpack, follow the "Configuration" links below. More information on extending the buildpack is available [here](docs/extending.md).
4559

docs/container-groovy.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ Tags are printed to standard output by the buildpack detect script
2222
Any JAR files found in the application are automatically added to the classpath at runtime.
2323

2424
## Configuration
25-
For general information on configuring the buildpack, refer to [Configuration and Extension][].
25+
For general information on configuring the buildpack, including how to specify configuration values through environment variables, refer to [Configuration and Extension][].
2626

2727
The container can be configured by modifying the [`config/groovy.yml`][] file in the buildpack fork. The container uses the [`Repository` utility support][repositories] and so it supports the [version syntax][] defined there.
2828

docs/container-java_main.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ If the application uses Spring, [Spring profiles][] can be specified by setting
2525
If the main class is Spring Boot's `JarLauncher`, `PropertiesLauncher` or `WarLauncher`, the Java Main Container adds a `--server.port` argument to the command so that the application uses the correct port.
2626

2727
## Configuration
28-
For general information on configuring the buildpack, refer to [Configuration and Extension][].
28+
For general information on configuring the buildpack, including how to specify configuration values through environment variables, refer to [Configuration and Extension][].
2929

3030
The container can be configured by modifying the `config/java_main.yml` file in the buildpack fork.
3131

docs/container-spring_boot_cli.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ Tags are printed to standard output by the buildpack detect script.
2222
If the application uses Spring, [Spring profiles][] can be specified by setting the [`SPRING_PROFILES_ACTIVE`][] environment variable. This is automatically detected and used by Spring. The Spring Auto-reconfiguration Framework will specify the `cloud` profile in addition to any others.
2323

2424
## Configuration
25-
For general information on configuring the buildpack, refer to [Configuration and Extension][].
25+
For general information on configuring the buildpack, including how to specify configuration values through environment variables, refer to [Configuration and Extension][].
2626

2727
The container can be configured by modifying the [`config/spring_boot_cli.yml`][] file in the buildpack fork. The container uses the [`Repository` utility support][repositories] and so it supports the [version syntax][] defined there.
2828

docs/container-tomcat.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Tags are printed to standard output by the buildpack detect script
1515
If the application uses Spring, [Spring profiles][] can be specified by setting the [`SPRING_PROFILES_ACTIVE`][] environment variable. This is automatically detected and used by Spring. The Spring Auto-reconfiguration Framework will specify the `cloud` profile in addition to any others.
1616

1717
## Configuration
18-
For general information on configuring the buildpack, refer to [Configuration and Extension][].
18+
For general information on configuring the buildpack, including how to specify configuration values through environment variables, refer to [Configuration and Extension][].
1919

2020
The container can be configured by modifying the [`config/tomcat.yml`][] file in the buildpack fork. The container uses the [`Repository` utility support][repositories] and so it supports the [version syntax][] defined there.
2121

docs/extending-caches.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ end
3939
```
4040

4141
## Configuration
42-
For general information on configuring the buildpack, refer to [Configuration and Extension][].
42+
For general information on configuring the buildpack, including how to specify configuration values through environment variables, refer to [Configuration and Extension][].
4343

4444
Caching can be configured by modifying the [`config/cache.yml`][] file in the buildpack fork.
4545

docs/extending-logging.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ logger.debug { "#{costly_method}" }
2424
```
2525

2626
## Configuration
27-
For general information on configuring the buildpack, refer to [Configuration and Extension][].
27+
For general information on configuring the buildpack, including how to specify configuration values through environment variables, refer to [Configuration and Extension][].
2828

2929
The console logging severity filter is set to `DEBUG`, `INFO`, `WARN`, `ERROR`, `FATAL` using the following strategies in descending priority:
3030

docs/extending-repositories.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ end
5959
| `{architecture}` | The architecture of the system as returned by Ruby. The value is typically one of `x86_64` or `x86`.
6060

6161
## Configuration
62-
For general information on configuring the buildpack, refer to [Configuration and Extension][].
62+
For general information on configuring the buildpack, including how to specify configuration values through environment variables, refer to [Configuration and Extension][].
6363

6464
Repositories can be configured by modifying the [`config/repository.yml`][] file in the buildpack fork.
6565

docs/framework-app_dynamics_agent.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ When binding AppDynamics using a user-provided service, it must have name or tag
2929
To provide more complex values such as the `tier-name`, using the interactive mode when creating a user-provided service will manage the character escaping automatically. For example, the default `tier-name` could be set with a value of `Tier-$(expr "$VCAP_APPLICATION" : '.*instance_index[": ]*\([[:digit:]]*\).*')` to calculate a value from the Cloud Foundry instance index.
3030

3131
## Configuration
32-
For general information on configuring the buildpack, refer to [Configuration and Extension][].
32+
For general information on configuring the buildpack, including how to specify configuration values through environment variables, refer to [Configuration and Extension][].
3333

3434
The framework can be configured by modifying the [`config/app_dynamics_agent.yml`][] file in the buildpack fork. The framework uses the [`Repository` utility support][repositories] and so it supports the [version syntax][] defined there.
3535

docs/framework-dyna_trace_agent.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ TIP: Changes will not apply to existing running applications until they are rest
5858
```
5959

6060
## Configuration
61-
For general information on configuring the buildpack, refer to [Configuration and Extension][].
61+
For general information on configuring the buildpack, including how to specify configuration values through environment variables, refer to [Configuration and Extension][].
6262

6363
The framework can be configured by modifying the [`config/dyna_trace_agent.yml`][] file in the buildpack fork. The framework uses the [`Repository` utility support][repositories] and so it supports the [version syntax][] defined there.
6464

0 commit comments

Comments
 (0)