diff options
Diffstat (limited to '.travis/tox-bootstrapd-docker')
-rwxr-xr-x | .travis/tox-bootstrapd-docker | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/.travis/tox-bootstrapd-docker b/.travis/tox-bootstrapd-docker index bd192f07..e370118d 100755 --- a/.travis/tox-bootstrapd-docker +++ b/.travis/tox-bootstrapd-docker | |||
@@ -1,8 +1,10 @@ | |||
1 | #!/bin/sh | 1 | #!/bin/bash |
2 | 2 | ||
3 | set -exu | 3 | set -exu |
4 | 4 | ||
5 | tar c $(git ls-files) | docker build -f other/bootstrap_daemon/docker/Dockerfile -t toxchat/bootstrap-node - | 5 | readarray -t FILES <<<"$(git ls-files)" |
6 | |||
7 | tar c "${FILES[@]}" | docker build -f other/bootstrap_daemon/docker/Dockerfile -t toxchat/bootstrap-node - | ||
6 | sudo useradd \ | 8 | sudo useradd \ |
7 | --home-dir /var/lib/tox-bootstrapd \ | 9 | --home-dir /var/lib/tox-bootstrapd \ |
8 | --create-home \ | 10 | --create-home \ |
@@ -29,12 +31,12 @@ fi | |||
29 | 31 | ||
30 | COUNTER=0 | 32 | COUNTER=0 |
31 | COUNTER_END=120 | 33 | COUNTER_END=120 |
32 | while [ $COUNTER -lt $COUNTER_END ]; do | 34 | while [ "$COUNTER" -lt "$COUNTER_END" ]; do |
33 | if docker logs tox-bootstrapd | grep -q "Connected to another bootstrap node successfully" ; then | 35 | if docker logs tox-bootstrapd | grep -q "Connected to another bootstrap node successfully"; then |
34 | break | 36 | break |
35 | fi | 37 | fi |
36 | sleep 1 | 38 | sleep 1 |
37 | COUNTER=$(($COUNTER+1)) | 39 | COUNTER=$(($COUNTER + 1)) |
38 | done | 40 | done |
39 | 41 | ||
40 | docker logs tox-bootstrapd | 42 | docker logs tox-bootstrapd |
@@ -49,18 +51,18 @@ sleep 30 | |||
49 | 51 | ||
50 | docker ps -a | 52 | docker ps -a |
51 | 53 | ||
52 | if [ "`docker inspect -f {{.State.Running}} tox-bootstrapd`" != "true" ]; then | 54 | if [ "$(docker inspect -f {{.State.Running}} tox-bootstrapd)" != "true" ]; then |
53 | echo "Error: Container is not running" | 55 | echo "Error: Container is not running" |
54 | exit 1 | 56 | exit 1 |
55 | fi | 57 | fi |
56 | 58 | ||
57 | cat /proc/$(pidof tox-bootstrapd)/limits | 59 | cat /proc/"$(pidof tox-bootstrapd)"/limits |
58 | if ! cat /proc/$(pidof tox-bootstrapd)/limits | grep -P '^Max open files(\s+)32768(\s+)32768(\s+)files'; then | 60 | if ! grep -P '^Max open files(\s+)32768(\s+)32768(\s+)files' /proc/"$(pidof tox-bootstrapd)"/limits; then |
59 | echo "Error: ulimit is not set to the expected value" | 61 | echo "Error: ulimit is not set to the expected value" |
60 | exit 1 | 62 | exit 1 |
61 | fi | 63 | fi |
62 | 64 | ||
63 | if ! other/fun/bootstrap_node_info.py ipv4 localhost 33445 ; then | 65 | if ! other/fun/bootstrap_node_info.py ipv4 localhost 33445; then |
64 | echo "Error: Unable to get bootstrap node info" | 66 | echo "Error: Unable to get bootstrap node info" |
65 | exit 1 | 67 | exit 1 |
66 | fi | 68 | fi |