diff --git a/README.md b/README.md index be14d25a..6498f316 100644 --- a/README.md +++ b/README.md @@ -322,7 +322,7 @@ There are some limitations to what characters you can use. Variables will be replaced in files with the following extensions: `.yml`, `.yaml`, `.txt`, `.cfg`, `.conf`, `.properties`. -Specific files can be excluded by listing their name (without path) in the variable `REPLACE_ENV_VARIABLES_EXCLUDES`. +Specific files can be excluded by listing their name (without path) in the variable `REPLACE_ENV_VARIABLES_EXCLUDES`. Paths can be excluded by listing them in the variable `REPLACE_ENV_VARIABLES_EXCLUDE_PATHS`. Here is a full example where we want to replace values inside a `database.yml`. diff --git a/start-finalSetupEnvVariables b/start-finalSetupEnvVariables index 4ec1b7ee..f64f5ec7 100644 --- a/start-finalSetupEnvVariables +++ b/start-finalSetupEnvVariables @@ -11,6 +11,9 @@ if isTrue "${REPLACE_ENV_VARIABLES}"; then for f in ${REPLACE_ENV_VARIABLES_EXCLUDES}; do findExcludes="${findExcludes} -not -name $f" done + for p in ${REPLACE_ENV_VARIABLES_EXCLUDE_PATHS}; do + findExcludes="${findExcludes} -not -path \"*$p*\"" + done isDebugging && echo "Using find exclusion: $findExcludes" while IFS='=' read -r name value ; do