Browse Source

Merge pull request #278 from CatalystCode/enhancement/test-production-databases

Enhancement/Test production databases
pull/311/head
Hiroki Nakayama 5 years ago
committed by GitHub
parent
commit
2f997c7e60
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 19 additions and 3 deletions
  1. 18
      .travis.yml
  2. 4
      Dockerfile

18
.travis.yml

@ -3,14 +3,30 @@ language: python
python:
- "3.6"
env:
- DATABASE=sqlite
- DATABASE=postgres
services:
- docker
before_install:
- docker network create doccano
- >
if [[ "${DATABASE}" = "postgres" ]]; then
docker run --rm --name=postgres --network=doccano -d -e POSTGRES_USER=user -e POSTGRES_PASSWORD=pass -e POSTGRES_DB=db postgres
export DATABASE_URL="postgres://user:pass@postgres:5432/db?sslmode=disable"
fi
install:
- pip install mkdocs mkdocs-material
script:
- docker build --target=builder .
- docker build --target=builder --tag=doccano-test .
- >
if [[ "${DATABASE}" != "sqlite" ]]; then
docker run --network doccano -e DATABASE_URL="${DATABASE_URL}" -it doccano-test sh -c 'app/manage.py migrate && app/manage.py test api.tests server.tests'
fi
before_deploy:
- mkdocs build --verbose --clean

4
Dockerfile

@ -19,8 +19,8 @@ RUN pip install -r /requirements.txt \
COPY . /doccano
RUN cd /doccano \
&& tools/ci.sh
WORKDIR /doccano
RUN tools/ci.sh
FROM builder AS cleaner

Loading…
Cancel
Save