Skip to content

Commit

Permalink
first commit after re-initialising Doccano Repo - to remove useless h…
Browse files Browse the repository at this point in the history
…istory
  • Loading branch information
guillim committed Aug 5, 2019
0 parents commit b305d3c
Show file tree
Hide file tree
Showing 266 changed files with 21,787 additions and 0 deletions.
19 changes: 19 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
[report]
omit =
app/app/wsgi.py
app/classifier/*
app/server/migrations/*
app/server/templatetags/*
app/server/tests/*
app/api/migrations/*
app/api/tests/*
app/authentification/tests/*
app/authentification/templatetags/*

exclude_lines =
pragma: no cover
if __name__ == .__main__.
def __str__
raise NotImplementedError

fail_under = 90
19 changes: 19 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
*
!app/
!tests/
!tools/
!.coveragerc
!.flake8
!requirements.txt

app/**/bundle/
app/**/node_modules/
app/**/webpack-stats.json

app/**/*.sqlite3
app/**/.env
app/**/junitxml/
app/**/staticfiles/
app/**/venv/
app/**/__pycache__/
tests/**/__pycache__/
3 changes: 3 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[flake8]
filename = app/*
max-line-length = 120
203 changes: 203 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,203 @@
# Created by .ignore support plugin (hsz.mobi)
### macOS template
# General
.DS_Store
.AppleDouble
.LSOverride

# Icon must end with two \r
Icon

# Thumbnails
._*

# Files that might appear in the root of a volume
.DocumentRevisions-V100
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
.VolumeIcon.icns
.com.apple.timemachine.donotpresent

# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk
### Python template
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
.hypothesis/
junitxml/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py
*.sqlite3
staticfiles/

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
target/

# Jupyter Notebook
.ipynb_checkpoints

# pyenv
.python-version

# celery beat schedule file
celerybeat-schedule

# SageMath parsed files
*.sage.py

# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/
### JetBrains template
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and Webstorm
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839

# User-specific stuff:
.idea/**/workspace.xml
.idea/**/tasks.xml
.idea/dictionaries

# Sensitive or high-churn files:
.idea/**/dataSources/
.idea/**/dataSources.ids
.idea/**/dataSources.xml
.idea/**/dataSources.local.xml
.idea/**/sqlDataSources.xml
.idea/**/dynamic.xml
.idea/**/uiDesigner.xml

# Gradle:
.idea/**/gradle.xml
.idea/**/libraries

# CMake
cmake-build-debug/

# Mongo Explorer plugin:
.idea/**/mongoSettings.xml

## File-based project format:
*.iws

## Plugin-specific files:

# IntelliJ
out/

# mpeltonen/sbt-idea plugin
.idea_modules/

# JIRA plugin
atlassian-ide-plugin.xml

# Cursive Clojure plugin
.idea/replstate.xml

# Crashlytics plugin (for Android Studio and IntelliJ)
com_crashlytics_export_strings.xml
crashlytics.properties
crashlytics-build.properties
fabric.properties
### VirtualEnv template
# Virtualenv
# http://iamzed.com/2009/05/07/a-primer-on-virtualenv/
[Bb]in
[Ii]nclude
[Ll]ib
[Ll]ib64
[Ll]ocal
[Ss]cripts
pyvenv.cfg
pip-selfcheck.json

# ignore webpack state
node_modules/
bundle/
webpack-stats.json

# database
app/db
50 changes: 50 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
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 --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

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
68 changes: 68 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
ARG PYTHON_VERSION="3.6"
FROM python:${PYTHON_VERSION}-stretch AS builder

ARG NODE_VERSION="8.x"
RUN curl -sL "https://deb.nodesource.com/setup_${NODE_VERSION}" | bash - \
&& apt-get install --no-install-recommends -y \
nodejs=8.16.0-1nodesource1

RUN apt-get install --no-install-recommends -y \
unixodbc-dev=2.3.4-1

COPY app/server/static/package*.json /doccano/app/server/static/
RUN cd /doccano/app/server/static \
&& npm ci

COPY requirements.txt /
RUN pip install -r /requirements.txt \
&& pip wheel -r /requirements.txt -w /deps

COPY . /doccano

WORKDIR /doccano
RUN tools/ci.sh

FROM builder AS cleaner

RUN cd /doccano/app/server/static \
&& SOURCE_MAP=False DEBUG=False npm run build \
&& rm -rf components pages node_modules .*rc package*.json webpack.config.js

RUN cd /doccano \
&& python app/manage.py collectstatic --noinput

FROM python:${PYTHON_VERSION}-slim-stretch AS runtime

RUN apt-get update \
&& apt-get install --no-install-recommends -y \
curl=7.52.1-5+deb9u9 \
gnupg=2.1.18-8~deb9u4 \
apt-transport-https=1.4.9 \
&& curl -fsS https://packages.microsoft.com/keys/microsoft.asc | apt-key add - \
&& curl -fsS https://packages.microsoft.com/config/debian/9/prod.list > /etc/apt/sources.list.d/mssql.list \
&& apt-get update \
&& ACCEPT_EULA=Y apt-get install --no-install-recommends -y \
msodbcsql17=17.3.1.1-1 \
mssql-tools=17.3.0.1-1 \
&& apt-get remove -y curl gnupg apt-transport-https \
&& rm -rf /var/lib/apt/lists/*

RUN useradd -ms /bin/sh doccano

COPY --from=builder /deps /deps
RUN pip install --no-cache-dir /deps/*.whl

COPY --from=cleaner --chown=doccano:doccano /doccano /doccano

ENV DEBUG="True"
ENV SECRET_KEY="change-me-in-production"
ENV PORT="8000"
ENV WORKERS="2"
ENV GOOGLE_TRACKING_ID=""
ENV AZURE_APPINSIGHTS_IKEY=""

USER doccano
WORKDIR /doccano
EXPOSE ${PORT}

CMD ["/doccano/tools/run.sh"]
16 changes: 16 additions & 0 deletions ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
If you open a GitHub issue, here is our policy:

1. It must be a bug, a feature request, or a significant problem with documentation (for small docs fixes please send a PR instead).
2. The form below must be filled out.

------------------------

### System information
- **OS Platform and Distribution (e.g., Linux Ubuntu 16.04)**:
- **Python version**:

### Describe the problem
Describe the problem clearly here. Be sure to convey here why it's a bug or a feature request.

### Source code / logs
Include any logs or source code that would be helpful to diagnose the problem. If including tracebacks, please include the full traceback. Large logs and files should be attached. Try to provide a reproducible test case that is the bare minimum necessary to generate the problem.
Loading

0 comments on commit b305d3c

Please sign in to comment.