32 lines
896 B
Bash
Executable File
32 lines
896 B
Bash
Executable File
#!/usr/bin/env bash
|
|
|
|
echo "generating hosts file..."
|
|
|
|
hosts_file_path="./tests/resources/local_hosts"
|
|
|
|
echo "removing old file..."
|
|
rm $hosts_file_path
|
|
|
|
# default entries
|
|
# the server
|
|
echo "10.0.0.3 abra.local" >> $hosts_file_path
|
|
# used to spin up traefik
|
|
echo "10.0.0.3 traefik.abra.local" >> $hosts_file_path
|
|
# used in integration tests
|
|
echo "10.0.0.3 gitea.abra.local" >> $hosts_file_path
|
|
echo "10.0.0.3 zammad.abra.local" >> $hosts_file_path
|
|
echo "10.0.0.3 custom-html.abra.local" >> $hosts_file_path
|
|
echo "10.0.0.3 foo.abra.local" >> $hosts_file_path
|
|
echo "10.0.0.3 foobar.abra.local" >> $hosts_file_path
|
|
|
|
search_dir=./tests/integration
|
|
for entry in "$search_dir"/*.bats
|
|
do
|
|
base_name=$(basename "${entry}")
|
|
# converting file names to testing subdomains
|
|
subdomain=$(echo "$base_name" | tr . _)
|
|
echo "10.0.0.3 $subdomain.abra.local" >> $hosts_file_path
|
|
done
|
|
|
|
echo "writing hosts success"
|