language: python python: - "3.6" env: - DATABASE=sqlite - DATABASE=postgres - DATABASE=mssql 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" elif [[ "${DATABASE}" = "mssql" ]]; then docker run --rm --name=mssql --network=doccano -d -e ACCEPT_EULA=y -e SA_PASSWORD=sUp3rS3cr3t mcr.microsoft.com/mssql/server:2017-latest docker exec -it mssql sh -c "while ! /opt/mssql-tools/bin/sqlcmd -U SA -P sUp3rS3cr3t -Q 'CREATE DATABASE db;'; do sleep 3; done" export DATABASE_URL="mssql://SA:sUp3rS3cr3t@mssql:1433/db?sslmode=disable" fi install: - pip install mkdocs mkdocs-material script: - 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 wait_for_db && app/manage.py migrate && app/manage.py test api.tests server.tests' fi before_deploy: - mkdocs build --verbose --clean deploy: - provider: script script: tools/cd.sh travis-${TRAVIS_BUILD_NUMBER} on: branch: master - provider: script script: tools/cd.sh ${TRAVIS_TAG} on: tags: true - provider: pages skip_cleanup: true github_token: $GITHUB_TOKEN local_dir: site on: branch: master