diff --git a/.travis.yml b/.travis.yml index ccfb083..f1d2e35 100644 --- a/.travis.yml +++ b/.travis.yml @@ -30,21 +30,18 @@ jobs: script: - npm run prettier-check - stage: unit test + language: python + python: + - "3.6" services: - docker - postgresql addons: postgresql: "9.6" + before_install: + - cd backend before_script: - - docker login -u _json_key -p "$(echo $GCR_REGSITRY_SERVICE_ACCOUNT | base64 -d)" https://gcr.io - psql -c 'create database travis_ci_test;' -U postgres script: - # need to support branches with / in the their name. Do this by replacing / with - - - IMAGE_WITH_TAG=$TEST_IMAGE:${TRAVIS_PULL_REQUEST_BRANCH:-$TRAVIS_BRANCH} - - - docker pull $IMAGE_WITH_TAG || docker pull $TEST_IMAGE:latest || true - - docker build --cache-from $IMAGE_WITH_TAG --cache-from $TEST_IMAGE:latest -t $IMAGE_WITH_TAG -t $TEST_IMAGE:latest -f server.Dockerfile . - - docker push $IMAGE_WITH_TAG # push this first so we don't have to rebuild if tests fail - - docker run --net=host $IMAGE_WITH_TAG python manage.py test -v 2 - - docker push $TEST_IMAGE:latest - + - cd .. + - python manage.py test -v 2