-
Notifications
You must be signed in to change notification settings - Fork 1
/
start-server
executable file
·32 lines (25 loc) · 1.05 KB
/
start-server
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/usr/bin/env bash
loc=$(cd $(dirname "${BASH_SOURCE[0]}") && pwd)
pushd $loc
set -euo pipefail
image=gnode/gin-web
docker pull ${image} || true # don't fail if offline
# Create first server, initialise it with config data, and start it
docker create -p 3000:3000 -p 2222:22 --name gintestserver ${image}
docker cp ./gin-data.init/. gintestserver:/data/.
docker start gintestserver
# Create second server, initialise it with config data, and start it
docker create -p 4000:3000 -p 2424:22 --name gintestserverb ${image}
docker cp ./gin-data.init/. gintestserverb:/data/.
docker start gintestserverb
if [[ $(uname -s) == "Darwin" ]]; then
# check if localhost aliases are set
iflocal=$(ifconfig lo0)
if ! [[ ${iflocal} =~ "127.0.0.2" && ${iflocal} =~ "127.0.0.3" ]]; then
echo "Tests on macOS need 127.0.0.2 and 127.0.0.3 set up as aliases for localhost"
echo "sudo ifconfig lo0 alias 127.0.0.2"
sudo ifconfig lo0 alias 127.0.0.2
echo "sudo ifconfig lo0 alias 127.0.0.3"
sudo ifconfig lo0 alias 127.0.0.3
fi
fi