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

+39
-25
lines changed

README.md

+18-4
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

+1-1
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

+1-1
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

+1-1
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

+1-1
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

+1-1
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

+1-1
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

+1-1
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

+1-1
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

+1-1
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

docs/framework-introscope_agent.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ The credential payload of the service may contain the following entries:
3131
To provide more complex values such as the `agent-name`, using the interactive mode when creating a user-provided service will manage the character escaping automatically. For example, the default `agent-name` could be set with a value of `agent-$(expr "$VCAP_APPLICATION" : '.*application_name[": ]*\([[:word:]]*\).*')` to calculate a value from the Cloud Foundry application name.
3232

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

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

docs/framework-java_opts.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Tags are printed to standard output by the buildpack detect script
1616

1717

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

2121
The framework can be configured by creating or modifying the [`config/java_opts.yml`][] file in the buildpack fork.
2222

docs/framework-jrebel_agent.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Tags are printed to standard output by the buildpack detect script
1717
For more information regarding setup and configuration, please refer to the [JRebel with Pivotal Cloud Foundry tutorial][pivotal].
1818

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

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

docs/framework-luna_security_provider.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ When binding to the Luna Security Provider using a user-provided service, it mus
2727
To provide more complex values such as the PEM certificates, using the interactive mode when creating a user-provided service will manage the character escaping automatically.
2828

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

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

docs/framework-maria_db_jdbc.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ Tags are printed to standard output by the buildpack detect script
2424
Users may optionally provide their own MariaDB or MySQL service. A user-provided MariaDB or MySQL service must have a name or tag with `mariadb` or `mysql` in it so that the MariaDB JDBC Framework will automatically download the JDBC driver JAR and place it on the classpath.
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 framework can be configured by modifying the [`config/maria_db_jdbc.yml`][] file in the buildpack fork. The framework uses the [`Repository` utility support][repositories] and so it supports the [version syntax][] defined there.
3030

docs/framework-new_relic_agent.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ The credential payload of the service may contain the following entries:
2828
| `***` | (Optional) Any additional entries will be applied as a system property appended to `-Dnewrelic.config.` to allow full configuration of the agent.
2929

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

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

docs/framework-play_framework_auto_reconfiguration.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ The Play Framework Auto-reconfiguration Framework causes an application to be au
1414
Tags are printed to standard output by the buildpack detect script
1515

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

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

docs/framework-play_framework_jpa_plugin.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ The Play Framework JPA Plugin Framework causes an application to be automaticall
1919
Tags are printed to standard output by the buildpack detect script
2020

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

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

docs/framework-postgresql_jdbc.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ Tags are printed to standard output by the buildpack detect script
2222
Users may optionally provide their own PostgreSQL service. A user-provided PostgreSQL service must have a name or tag with `postgres` in it so that the PostgreSQL JDBC Framework will automatically download the JDBC driver JAR and place it on the classpath.
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 framework can be configured by modifying the [`config/postgresql_jdbc.yml`][] file in the buildpack fork. The framework uses the [`Repository` utility support][repositories] and so it supports the [version syntax][] defined there.
2828

docs/framework-spring_auto_reconfiguration.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Tags are printed to standard output by the buildpack detect script
1616
If a `/WEB-INF/web.xml` file exists, the framework will modify it in addition to making the auto-reconfiguration JAR available on the classpath. This modification consists of adding `org.cloudfoundry.reconfiguration.spring.CloudProfileApplicationContextInitializer`, `org.cloudfoundry.reconfiguration.spring.CloudPropertySourceApplicationContextInitializer`, and `org.cloudfoundry.reconfiguration.spring.CloudAutoReconfigurationApplicationContextInitializer` to the collection of `contextInitializerClasses`. The Spring Auto-reconfiguration Framework also adds the `cloud` profile to any existing Spring profiles such as those defined in the [`SPRING_PROFILES_ACTIVE`][] environment variable.
1717

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

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

docs/jre-open_jdk_jre.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ The OpenJDK JRE provides Java runtimes from the [OpenJDK][] project. Versions o
1414
Tags are printed to standard output by the buildpack detect script
1515

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

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

docs/jre-oracle_jre.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ Tags are printed to standard output by the buildpack detect script
2323
For details on the repository structure, see the [repository documentation][repositories].
2424

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

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

0 commit comments

Comments
 (0)