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
|
|
|
|
|
git clone --depth=1 https://github.com/letsencrypt/boulder ${BOULDERPATH}
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
cd ${BOULDERPATH}
|
2016-08-10 14:49:55 -04:00
|
|
|
FAKE_DNS=$(ifconfig docker0 | grep "inet addr:" | cut -d: -f2 | awk '{ print $1}')
|
2017-03-29 16:34:09 -04:00
|
|
|
[ -z "$FAKE_DNS" ] && FAKE_DNS=$(ifconfig docker0 | grep "inet " | xargs | cut -d ' ' -f 2)
|
2017-05-05 11:49:54 -04:00
|
|
|
[ -z "$FAKE_DNS" ] && FAKE_DNS=$(ip addr show dev docker0 | grep "inet " | xargs | cut -d ' ' -f 2 | cut -d '/' -f 1)
|
2017-03-29 16:34:09 -04:00
|
|
|
[ -z "$FAKE_DNS" ] && echo Unable to find the IP for docker0 && exit 1
|
2017-02-15 00:19:18 -05:00
|
|
|
sed -i "s/FAKE_DNS: .*/FAKE_DNS: ${FAKE_DNS}/" docker-compose.yml
|
2016-05-23 16:18:02 -04:00
|
|
|
docker-compose up -d
|
2017-10-12 20:00:13 -04:00
|
|
|
|
|
|
|
|
set +x # reduce verbosity while waiting for boulder
|
|
|
|
|
until curl http://localhost:4000/directory 2>/dev/null; do
|
|
|
|
|
echo waiting for boulder
|
|
|
|
|
sleep 1
|
|
|
|
|
done
|