addons-server/scripts/ui-test-hostname-setup.sh

10 строки
623 B
Bash
Executable File

#!/bin/bash
# This script sets the ip of the addons-frontend image as localhost within the selenium-firefox image.
# This MUST be run before any user integration tests.
UI_IP="`docker inspect addons-server_addons-frontend_1 | grep "IPAddress" | grep -oE "\b([0-9]{1,3}\.){3}[0-9]{1,3}\b"`"
echo $UI_IP
HOSTS_LINE="$UI_IP\tlocalhost"
docker-compose -f docker-compose.yml -f tests/ui/docker-compose.selenium.yml exec --user root selenium-firefox sudo -- sh -c -e "echo '$HOSTS_LINE' >> /etc/hosts"
docker-compose -f docker-compose.yml -f tests/ui/docker-compose.selenium.yml exec --user root selenium-firefox cat /etc/hosts