Here is my config.yml:
version: 2
jobs:
build:
working_directory: /app
docker:
- image: bayesimpact/circleci
steps:
- checkout
- setup_remote_docker
- restore_cache: # restores saved depdendency cache if Branch key template or requirements haven't changed
keys:
- v1-{{ .Branch }}-{{ checksum "requirements/test.txt" }}
- v1-{{ .Branch }}-dependencies
- run:
name: Install dependencies
command: |
pip3 install virtualenv
python3 -m venv venv
. venv/bin/activate
pip3 install --upgrade pip setuptools
pip3 install -r requirements/test.txt
- save_cache: # save dependency cache
key: v1-{{ .Branch }}-{{ checksum "requirements/test.txt" }}
paths:
- ./venv
- restore_cache: # restore saved docker image cache if hasn't changed
keys:
- v1-{{ .Branch }}
paths:
- /caches/app.tar
- run:
name: Load Docker image layer cache
command: |
set +o pipefail
docker load -i /caches/app.tar | true
- run:
name: Build and tag application Docker image
command: |
docker build --cache-from=app -t app -f Dockerfile.test .
docker tag app app:testing
- run:
name: Save Docker image layer cache
command: |
mkdir -p /caches
docker save -o /caches/app.tar app
- save_cache: # save docker image cache
key: v1-{{ .Branch }}-{{ epoch }}
paths:
- /caches/app.tar
- run:
name: Build compose
command: |
docker-compose -f docker-compose.test.yml build
- run:
name: Run tests
command: |
docker-compose -f docker-compose.test.yml up
- store_test_results:
path: test-results
- store_artifacts:
path: test-results
Everything is working except I run into this error when I go to run everything:
app_1 | python: can't open file 'manage.py': [Errno 2] No such file or directory
db_1 | 2018-09-06 14:01:37.581 UTC [30] WARNING: no usable system locales were found
app_app_1 exited with code 2