diff --git a/docker/spring-cloud-contract-stub-runner-docker/run.sh b/docker/spring-cloud-contract-stub-runner-docker/run.sh index 3acd972ac7..ba2f3fa70d 100755 --- a/docker/spring-cloud-contract-stub-runner-docker/run.sh +++ b/docker/spring-cloud-contract-stub-runner-docker/run.sh @@ -6,4 +6,12 @@ set -o nounset set -o pipefail echo "Running Spring Cloud Contract Stub Runner" -java -Djava.security.egd=file:/dev/./urandom -jar /stub-runner-boot.jar +ADDITIONAL_OPTS="${ADDITIONAL_OPTS:-}" +MESSAGING_TYPE="${MESSAGING_TYPE:-}" + +if [[ "${MESSAGING_TYPE}" != "" ]]; then + echo "Messaging type passed, will active thin profile [${MESSAGING_TYPE}]" + ADDITIONAL_OPTS="${ADDITIONAL_OPTS} --thin.profile=${MESSAGING_TYPE}" +fi + +java -Djava.security.egd=file:/dev/./urandom -jar /stub-runner-boot.jar ${ADDITIONAL_OPTS} diff --git a/docs/src/main/asciidoc/docker-project.adoc b/docs/src/main/asciidoc/docker-project.adoc index da88b2f698..fa940bfdb6 100644 --- a/docs/src/main/asciidoc/docker-project.adoc +++ b/docs/src/main/asciidoc/docker-project.adoc @@ -110,6 +110,10 @@ from the container's `.m2`. Mount your local `.m2` as a volume available at the CAUTION: You must not set both `EXTERNAL_CONTRACTS_WORK_OFFLINE` and `EXTERNAL_CONTRACTS_REPO_WITH_BINARIES_URL`. +The following environment variables are used when running messaging based tests: + +- `MESSAGING_TYPE` - what type of messaging system are you using (currently supported are `rabbit`, `kafka`) + The following environment variables are used when tests are run: - `APPLICATION_BASE_URL`: URL against which tests should be run. @@ -214,6 +218,11 @@ The dot (`.`) should be replaced with underscore (`_`) characters. For example, the `stubrunner.repositoryRoot` property should be represented as a `STUBRUNNER_REPOSITORY_ROOT` environment variable. +In addition to those variables you can set the following ones: + +- `MESSAGING_TYPE` - what type of messaging system are you using (currently supported are `rabbit`, `kafka`) +- `ADDITIONAL_OPTS` - any additional properties that you would like to pass to the application + [[docker-stubrunner-example]] === Example of Usage