diff options
Diffstat (limited to 'ansible_collections/hetzner/hcloud/scripts/integration-test-files.sh')
-rwxr-xr-x | ansible_collections/hetzner/hcloud/scripts/integration-test-files.sh | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/ansible_collections/hetzner/hcloud/scripts/integration-test-files.sh b/ansible_collections/hetzner/hcloud/scripts/integration-test-files.sh new file mode 100755 index 000000000..fbae089b5 --- /dev/null +++ b/ansible_collections/hetzner/hcloud/scripts/integration-test-files.sh @@ -0,0 +1,28 @@ +#!/usr/bin/env bash + +# Sync the integration test files from the template to all the integrations targets. + +integration_targets="tests/integration/targets/" +integration_common="tests/integration/common" + +# banner +banner() { + echo "#" + echo "# DO NOT EDIT THIS FILE! Please edit the files in $integration_common instead." + echo "#" +} + +# copy_file <src> <dest> +copy_file() { + mkdir -p "$(dirname "$2")" + banner > "$2" + cat "$1" >> "$2" +} + +for target in "$integration_targets"*; do + if [[ "$(basename "$target")" = setup_* ]]; then + continue + fi + copy_file "$integration_common"/defaults/main/common.yml "$target"/defaults/main/common.yml + copy_file "$integration_common"/tasks/main.yml "$target"/tasks/main.yml +done |