Skip to content

Commit

Permalink
Ensure tests fail faster, output docker logs
Browse files Browse the repository at this point in the history
  • Loading branch information
msheiny committed Aug 6, 2019
1 parent ef6ef1a commit f30305c
Showing 1 changed file with 21 additions and 5 deletions.
26 changes: 21 additions & 5 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,20 @@ jobs:
command: |
make dev-init
pipenv run docker-compose up -d
while ! curl --output /dev/null --silent --head --fail http://localhost:8000; do sleep 1 && echo -n .; done;
while ! curl --output /dev/null --silent --head --fail http://localhost:8000; do sleep 1; done;
pipenv run make dev-tests
pipenv run make check-migrations
no_output_timeout: 5m

- run:
name: Yank docker logs
command: |
mkdir -p ~/dockercomposelogs || true
pipenv run docker-compose logs > ~/dockercomposelogs/dev.log
when: always

- store_artifacts:
path: ~/dockercomposelogs

prod:
machine:
Expand All @@ -82,15 +93,20 @@ jobs:
command: |
pipenv run docker-compose -f prod-docker-compose.yaml build
pipenv run docker-compose -f prod-docker-compose.yaml up -d
while ! curl --output /dev/null --silent --head --fail http://$(docker-compose -f prod-docker-compose.yaml port nginx 8080); do sleep 1 && echo -n .; done;
while ! curl --output /dev/null --silent --head --fail http://$(docker-compose -f prod-docker-compose.yaml port nginx 8080); do sleep 1; done;
pipenv run docker-compose -f prod-docker-compose.yaml exec django /bin/bash -c "./manage.py createdevdata"
pipenv run pytest devops/tests/test_basic.py
no_output_timeout: 5m

- run:
name: Push prod containers
name: Yank docker logs
command: |
docker login -u "${QUAY_USER}" -p "${QUAY_PASS}" quay.io || true
make prod-push || true
mkdir -p ~/dockercomposelogs || true
pipenv run docker-compose -f prod-docker-compose.yaml logs > ~/dockercomposelogs/prod.log
when: always

- store_artifacts:
path: ~/dockercomposelogs

workflows:
version: 2
Expand Down

0 comments on commit f30305c

Please sign in to comment.