Skip to content

Commit

Permalink
Updated Travis scripts
Browse files Browse the repository at this point in the history
We now pull images prior to building. This helps avoid wasting time completely rebuilding the app container.

The db container is started first to ensure the database is ready before we attempt to run migrations.

Added test to ensure migrations have been generated, and run properly.
  • Loading branch information
clintonb committed Dec 17, 2018
1 parent c83c270 commit 82e36bf
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
4 changes: 4 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,15 @@ cache: pip

install:
- bash .travis/install_terraform.sh
- make docker.pull
- make docker.build

script:
- docker-compose -f docker-compose.yml -f docker-compose.travis.yml up -d db
- docker-compose -f docker-compose.yml -f docker-compose.travis.yml run app "make detect_missing_migrations"
- docker-compose -f docker-compose.yml -f docker-compose.travis.yml run app "make quality"
- docker-compose -f docker-compose.yml -f docker-compose.travis.yml run app "make static"
- docker-compose -f docker-compose.yml -f docker-compose.travis.yml run app "make migrate"
- docker-compose -f docker-compose.yml -f docker-compose.travis.yml run app "make test"
- make validate_terraform

Expand Down
5 changes: 4 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
.DEFAULT_GOAL := test

.PHONY: clean help requirements test validate quality production-requirements migrate static clean_static
.PHONY: clean detect_missing_migrations help requirements test validate quality production-requirements migrate static clean_static

# Generates a help message. Borrowed from https://github.com/pydanny/cookiecutter-djangopackage.
help: ## Display this help message
Expand Down Expand Up @@ -29,6 +29,9 @@ clean: ## Delete generated byte code and coverage reports
find . -name '*.pyc' -delete
coverage erase

detect_missing_migrations: ## Determine if any apps are missing generated migrations
python manage.py makemigrations --check --dry-run || (echo "Migration files are missing. Please run the "makemigrations" management command, and commit the migrations." && false)

requirements: ## Install requirements for local development
pipenv install --dev

Expand Down

0 comments on commit 82e36bf

Please sign in to comment.