Skip to content

Commit 84f1b74

Browse files
committed
Export benchmark hosts
1 parent e95840a commit 84f1b74

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

docker/docker-compose.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ services:
1111
dockerfile: docker/Dockerfile
1212
args:
1313
DOCKER_UID: ${DOCKER_UID}
14+
ports:
15+
- 80:80
1416
volumes:
1517
- ${INSTALLATION_PATH}:/var/www/phpbenchmarks
1618
- ../src:/var/phpbenchmarks

start.sh

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,16 @@ function startDockerContainer {
8282
echoActionDone
8383
}
8484

85+
function addHost() {
86+
local host=$1
87+
if [ "$(cat /etc/hosts | grep $host)" == "" ]; then
88+
echoAction "Add $host host in /etc/hosts"
89+
sudo bash -c "echo '127.0.0.1 $host' >> /etc/hosts"
90+
[ "$?" != "0" ] && exitScript "Error while adding host $host."
91+
echoActionDone
92+
fi
93+
}
94+
8595
trap onExit EXIT
8696

8797
currentAction=
@@ -91,6 +101,12 @@ defineInstallationPath
91101

92102
createPhpbenchmarksDirectory
93103

104+
addHost "php56.benchmark.loc"
105+
addHost "php70.benchmark.loc"
106+
addHost "php71.benchmark.loc"
107+
addHost "php72.benchmark.loc"
108+
addHost "php73.benchmark.loc"
109+
94110
cd docker
95111
buildDockerImage
96112
startDockerContainer

0 commit comments

Comments
 (0)