2015-11-06 19:58:40 -05:00
|
|
|
#!/bin/bash
|
|
|
|
|
# Download and run Boulder instance for integration testing
|
|
|
|
|
set -xe
|
|
|
|
|
|
2017-02-15 00:19:18 -05:00
|
|
|
# Clone Boulder into a GOPATH-style directory structure even if Go isn't
|
|
|
|
|
# installed, because Boulder's docker-compose.yml file wll look for it there.
|
|
|
|
|
export GOPATH=${GOPATH:-$HOME/gopath}
|
|
|
|
|
BOULDERPATH=${BOULDERPATH:-$GOPATH/src/github.com/letsencrypt/boulder}
|
|
|
|
|
if [ ! -d ${BOULDERPATH} ]; then
|
2018-04-17 20:17:15 -04:00
|
|
|
git clone --depth=1 https://github.com/letsencrypt/boulder ${BOULDERPATH}
|
2017-02-15 00:19:18 -05:00
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
cd ${BOULDERPATH}
|
2018-05-24 13:53:21 -04:00
|
|
|
sed -i "s/FAKE_DNS: .*/FAKE_DNS: 10.77.77.1/" docker-compose.yml
|
2018-03-01 13:11:15 -05:00
|
|
|
|
2018-05-23 14:33:21 -04:00
|
|
|
docker-compose up -d boulder
|
2017-10-12 20:00:13 -04:00
|
|
|
|
|
|
|
|
set +x # reduce verbosity while waiting for boulder
|
2018-05-24 13:53:21 -04:00
|
|
|
for n in `seq 1 150` ; do
|
|
|
|
|
if curl http://localhost:4000/directory 2>/dev/null; then
|
|
|
|
|
break
|
|
|
|
|
else
|
|
|
|
|
sleep 1
|
|
|
|
|
fi
|
2017-10-12 20:00:13 -04:00
|
|
|
done
|
2018-05-24 13:53:21 -04:00
|
|
|
|
|
|
|
|
if ! curl http://localhost:4000/directory 2>/dev/null; then
|
|
|
|
|
echo "timed out waiting for boulder to start"
|
|
|
|
|
exit 1
|
|
|
|
|
fi
|