From c996aba499c95c5c94a66188db7e4be846f0b107 Mon Sep 17 00:00:00 2001 From: Ben Hadfield Date: Sat, 17 Aug 2019 13:08:45 +0100 Subject: [PATCH] add builder dockerfile, update circleci to use --- .circleci/config.yml | 18 ++++++++---------- operations/django/Dockerfile | 4 ++-- operations/django/builder.Dockerfile | 9 +++++++++ run-tests.sh | 1 + 4 files changed, 20 insertions(+), 12 deletions(-) create mode 100644 operations/django/builder.Dockerfile diff --git a/.circleci/config.yml b/.circleci/config.yml index 52f96ad..6f0445b 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -3,24 +3,22 @@ version: 2.1 jobs: gatekeeper_test: docker: - - image: circleci/python:3 + - image: benmoose/gatekeeper-builder steps: - checkout - - setup_remote_docker - - run: - name: Build images - command: | - docker-compose build +# - setup_remote_docker +# - run: +# name: Build images +# command: | +# docker-compose build - run: name: Check code style command: | - docker-compose -f docker-compose.yml \ - run --rm --no-deps --entrypoint ./run-linter.sh server --check + ./run-linter.sh --check - run: name: Run tests command: | - docker-compose -f docker-compose.yml \ - run --rm --entrypoint ./run-tests.sh server + ./run-tests.sh -vv workflows: version: 2 diff --git a/operations/django/Dockerfile b/operations/django/Dockerfile index 9d6dcfd..13c17ee 100644 --- a/operations/django/Dockerfile +++ b/operations/django/Dockerfile @@ -3,8 +3,8 @@ ENV PYTHONUNBUFFERED 1 WORKDIR /wheels -COPY requirements*.txt requirements/ -RUN pip wheel -r ./requirements/requirements.test.txt +COPY requirements.txt requirements +RUN pip wheel -r ./requirements/requirements.txt FROM python:3.7-slim ENV PYTHONUNBUFFERED 1 diff --git a/operations/django/builder.Dockerfile b/operations/django/builder.Dockerfile new file mode 100644 index 0000000..9379c96 --- /dev/null +++ b/operations/django/builder.Dockerfile @@ -0,0 +1,9 @@ +FROM python:3.7 AS builder +ENV PYTHONUNBUFFERED 1 + +WORKDIR /usr/src/app + +COPY requirements*.txt /requirements/ +RUN pip install -r /requirements/requirements.test.txt + +COPY . . diff --git a/run-tests.sh b/run-tests.sh index c2355bf..06b3ea8 100755 --- a/run-tests.sh +++ b/run-tests.sh @@ -1,6 +1,7 @@ #!/bin/bash export ENVIRONMENT=test +export DJANGO_SETTINGS_MODULE=django_conf.settings export TWILIO_ACCOUNT_SID=test-account-sid export TWILIO_AUTH_TOKEN=test-auth-token