mirror of
https://github.com/docker-mailserver/docker-mailserver.git
synced 2025-08-04 01:55:29 +02:00
Give each container their own private config folder
This commit is contained in:
parent
e5d04aa30d
commit
5fef8a5b78
31 changed files with 138 additions and 105 deletions
|
@ -105,3 +105,19 @@ function run_teardown_file_if_necessary() {
|
|||
teardown_file
|
||||
fi
|
||||
}
|
||||
|
||||
# get the private config path for the given container or test file, if no container name was given
|
||||
function private_config_path() {
|
||||
echo "$PWD/test/duplicate_configs/${1:$BATS_TEST_FILENAME}"
|
||||
}
|
||||
|
||||
# @param $1 relative source in test/config folder
|
||||
# @param $2 (optional) container name, defaults to $BATS_TEST_FILENAME
|
||||
# @return path to the folder where the config is duplicated
|
||||
function duplicate_config_for_container() {
|
||||
output="$(private_config_path "$2")"
|
||||
rm -rf "$output" # cleanup
|
||||
mkdir -p "$output"
|
||||
cp -r "$PWD/test/config/$1" "$output"
|
||||
echo "$output"
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue