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
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with
19 additions and
3 deletions
-
.travis.yml
-
Dockerfile
|
@ -3,14 +3,30 @@ language: python |
|
|
python: |
|
|
python: |
|
|
- "3.6" |
|
|
- "3.6" |
|
|
|
|
|
|
|
|
|
|
|
env: |
|
|
|
|
|
- DATABASE=sqlite |
|
|
|
|
|
- DATABASE=postgres |
|
|
|
|
|
|
|
|
services: |
|
|
services: |
|
|
- docker |
|
|
- 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: |
|
|
install: |
|
|
- pip install mkdocs mkdocs-material |
|
|
- pip install mkdocs mkdocs-material |
|
|
|
|
|
|
|
|
script: |
|
|
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: |
|
|
before_deploy: |
|
|
- mkdocs build --verbose --clean |
|
|
- mkdocs build --verbose --clean |
|
|
|
@ -19,8 +19,8 @@ RUN pip install -r /requirements.txt \ |
|
|
|
|
|
|
|
|
COPY . /doccano |
|
|
COPY . /doccano |
|
|
|
|
|
|
|
|
RUN cd /doccano \ |
|
|
|
|
|
&& tools/ci.sh |
|
|
|
|
|
|
|
|
WORKDIR /doccano |
|
|
|
|
|
RUN tools/ci.sh |
|
|
|
|
|
|
|
|
FROM builder AS cleaner |
|
|
FROM builder AS cleaner |
|
|
|
|
|
|
|
|