summaryrefslogtreecommitdiff
path: root/.travis/tox-bootstrapd-docker
diff options
context:
space:
mode:
Diffstat (limited to '.travis/tox-bootstrapd-docker')
-rwxr-xr-x.travis/tox-bootstrapd-docker20
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
3set -exu 3set -exu
4 4
5tar c $(git ls-files) | docker build -f other/bootstrap_daemon/docker/Dockerfile -t toxchat/bootstrap-node - 5readarray -t FILES <<<"$(git ls-files)"
6
7tar c "${FILES[@]}" | docker build -f other/bootstrap_daemon/docker/Dockerfile -t toxchat/bootstrap-node -
6sudo useradd \ 8sudo 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
30COUNTER=0 32COUNTER=0
31COUNTER_END=120 33COUNTER_END=120
32while [ $COUNTER -lt $COUNTER_END ]; do 34while [ "$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))
38done 40done
39 41
40docker logs tox-bootstrapd 42docker logs tox-bootstrapd
@@ -49,18 +51,18 @@ sleep 30
49 51
50docker ps -a 52docker ps -a
51 53
52if [ "`docker inspect -f {{.State.Running}} tox-bootstrapd`" != "true" ]; then 54if [ "$(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
55fi 57fi
56 58
57cat /proc/$(pidof tox-bootstrapd)/limits 59cat /proc/"$(pidof tox-bootstrapd)"/limits
58if ! cat /proc/$(pidof tox-bootstrapd)/limits | grep -P '^Max open files(\s+)32768(\s+)32768(\s+)files'; then 60if ! 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
61fi 63fi
62 64
63if ! other/fun/bootstrap_node_info.py ipv4 localhost 33445 ; then 65if ! 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
66fi 68fi