Added REPLACE_ENV_VARIABLES_EXCLUDE_PATHS

For #575
This commit is contained in:
Geoff Bourne 2020-07-09 21:05:17 -05:00
parent 4cb12f6cae
commit 0bb9cccdc6
2 changed files with 4 additions and 1 deletions

View file

@ -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`.

View file

@ -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