Files
spring-cloud-contract/docker/spring-cloud-contract-docker/project/README.adoc
Bastian Doetsch 2f37b46dde Fixes #1672: allow users to specify a custom build.gradle when using standalone docker image (#1695)
* pre-create directories for mounting and use /spring/cloud-contract and /contract and /spring-cloud-contract

* add documentation on how to run a customized gradle build to create tests
2021-08-10 15:59:32 +02:00

25 lines
1.0 KiB
Plaintext

# Spring Cloud Contract Verifier Docker Project
## Developer tips
### Environment variables
In order to use a new environment variable inside the Gradle script, you need to add it to the `envVars` map together with a description and a default value. Otherwise, any attempt to resolve such an environment variable will lead to an exception being thrown.
If you're referencing any environment variables from inside the Java code please follow the following convention.
```java
/**
* Some description.
**/
@Value("${ENV_VAR_NAME:defaultValue}")
String envVar;
```
If you provide Javadocs, we will automatically parse any `@Value` annotated fields and build a table of environment variables with description and default values.
### Customizing the gradle build
You can provide a customized `gradle.build` to be run in the container by mounting your customized build file as a volume when running the container:
`docker run -v <absolute-path-of-your-custom-file>:/spring-cloud-contract/build.gradle springcloud/spring-cloud-contract:<version>`