Skip to content

Commit

Permalink
Print logs from container after failed healthcheck and only shallow
Browse files Browse the repository at this point in the history
clone to save space
  • Loading branch information
Joel Barciauskas authored and jbarciauskas committed Jun 26, 2017
1 parent bddea86 commit f3825bc
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ python:
- "3.5"

env:
- DEVSTACK_WORKSPACE=/tmp DOCKER_COMPOSE_VERSION=1.13.0
- DEVSTACK_WORKSPACE=/tmp DOCKER_COMPOSE_VERSION=1.13.0 SHALLOW_CLONE=1

services:
- docker
Expand Down
6 changes: 5 additions & 1 deletion clone.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,11 @@ do
if [ -d "$name" ]; then
printf "The [%s] repo is already checked out. Continuing.\n" $name
else
git clone $repo
if [ "$SHALLOW_CLONE" -eq 1 ]; then
git clone --depth=1 $repo
else
git clone $repo
fi
fi
done
cd - &> /dev/null
19 changes: 17 additions & 2 deletions healthchecks.sh
Original file line number Diff line number Diff line change
@@ -1,14 +1,29 @@
set -e
set -x

echo "Checking LMS heartbeat:"
curl http://localhost:18000/heartbeat # LMS
curl http://localhost:18000/heartbeat
if [[ $? -ne 0 ]]; then
docker-compose logs
exit 2
fi
echo
echo "Checking Studio heartbeat:"
curl http://localhost:18010/heartbeat # Studio
if [[ $? -ne 0 ]]; then
docker-compose logs
exit 2
fi
echo
echo "Checking ecommerce health:"
curl http://localhost:18130/health/ # Ecommerce
if [[ $? -ne 0 ]]; then
docker-compose logs
exit 2
fi
echo
echo "Checking discovery health:"
curl http://localhost:18381/health/ # Discovery
if [[ $? -ne 0 ]]; then
docker-compose logs
exit 2
fi
1 change: 0 additions & 1 deletion provision.sh
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ docker exec -i edx.devstack.mongo mongo < mongo-provision.js

# Nothing special needed for studio
docker-compose $DOCKER_COMPOSE_FILES up -d studio

./provision-ecommerce.sh
./provision-discovery.sh
./provision-credentials.sh
Expand Down

0 comments on commit f3825bc

Please sign in to comment.