Commit f505e39b authored by guglielmo's avatar guglielmo

initial commit

parents
# Basics
*.py[cod]
*.pyc
__pycache__
# Env file
.env
# Logs
*.log
pip-log.txt
# Unit test / coverage reports
.coverage
.tox
nosetests.xml
# Translations
*.mo
*.pot
# Pycharm
.idea
# Vim
*~
*.swp
*.swo
# npm
node_modules/
# Campass
.sass-cache
# data
*.csv
# osx .DS_Store
.DS_Store
stages:
- build
- test
- release
- deploy
variables:
CONTAINER_IMAGE: ${CI_REGISTRY}/${CI_PROJECT_PATH}:latest
DOCKER_DRIVER: overlay2
# -----------------------------------------------------------------------------
# build stage
# -----------------------------------------------------------------------------
build virtualenv:
image: python:latest
stage: build
variables:
DATABASE_URL: "sqlite://:memory:"
PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache"
cache:
key: "virtualenv-$CI_PROJECT_NAME"
paths:
- .cache/
- venv/
script:
- pip install virtualenv
- virtualenv venv
- source venv/bin/activate
- echo "$(python -V) from $(which python) - $(pip -V)"
- pip install -r requirements.txt
- pip install safety
- safety check
# -----------------------------------------------------------------------------
# test stage
# -----------------------------------------------------------------------------
django tests:
image: python:latest
stage: test
variables:
DATABASE_URL: "sqlite://:memory:"
PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache"
cache:
key: "virtualenv-$CI_PROJECT_NAME"
paths:
- .cache/
- venv/
before_script:
- source venv/bin/activate
- echo "$(python -V) from $(which python) - $(pip -V)"
- pip install coverage factory_boy Faker safety
script:
- coverage run manage.py test && coverage report
allow_failure: true
flake8:
image: python:latest
stage: test
variables:
PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache"
cache:
key: "virtualenv-$CI_PROJECT_NAME-$CI_JOB_NAME"
paths:
- .cache/
before_script:
- pip install flake8
script:
- flake8
allow_failure: true
# -----------------------------------------------------------------------------
# deploy stage
# -----------------------------------------------------------------------------
deploy_staging:
image: tmaier/docker-compose:18.06
stage: deploy
cache: {}
variables:
DEBUG: "on"
DOCKER_TLS_VERIFY: "1"
DOCKER_HOST: "tcp://${STAGING_HOST_IP}:2376"
DOCKER_CERT_PATH: "certs"
DOMAINS: ${DOMAINS_STAGING}
USE_EMAIL_SMTP: 0
EMAIL_HOST_PORT: 0
EMAIL_HOST_USE_TLS: 0
script:
- mkdir $DOCKER_CERT_PATH
- echo "$CA" > $DOCKER_CERT_PATH/ca.pem
- echo "$CLIENT_CERT" > $DOCKER_CERT_PATH/cert.pem
- echo "$CLIENT_KEY" > $DOCKER_CERT_PATH/key.pem
- docker build --compress -t depp/senato-ragazzi-2:latest .
- docker-compose down
- docker-compose up -d
- docker exec spir_web python manage.py collectstatic --noinput
- docker exec spir_web python manage.py migrate
- rm -rf $DOCKER_CERT_PATH
only:
- master
tags:
- docker
environment:
name: staging
url: https://${DOMAINS_STAGING}
.deploy_production:
image: tmaier/docker-compose:18.06
stage: deploy
cache: {}
variables:
DEBUG: "off"
DOCKER_TLS_VERIFY: "1"
DOCKER_HOST: "tcp://${PRODUCTION_HOST_IP}:2376"
DOCKER_CERT_PATH: "certs"
DOMAINS: ${DOMAINS_PRODUCTION}
script:
- mkdir $DOCKER_CERT_PATH
- echo "$CA" > $DOCKER_CERT_PATH/ca.pem
- echo "$CLIENT_CERT" > $DOCKER_CERT_PATH/cert.pem
- echo "$CLIENT_KEY" > $DOCKER_CERT_PATH/key.pem
- docker build --compress -t depp/senato-ragazzi-2:latest .
- docker-compose down
- docker-compose up -d --build --force-recreate
- docker exec senato-ragazzi-2_web_1 python manage.py collectstatic --noinput
- docker exec senato-ragazzi-2_web_1 python manage.py migrate
- rm -rf $DOCKER_CERT_PATH
only:
- master
when: manual
tags:
- docker
environment:
name: production
url: https://${DOMAINS_PRODUCTION}
Guglielmo Celata <guglielmo@openpolis.it>
FROM python:3.6-slim
# update, upgrade and install useful tools and aliases
RUN apt-get -y update \
&& apt-get install -y --no-install-recommends apt-utils \
&& apt-get -y upgrade \
&& apt-get install -y --no-install-recommends git-core tmux vim locales\
&& apt-get install -y --no-install-recommends gcc python-dev \
&& apt-get install -y --no-install-recommends binutils
# && rm -rf /var/lib/apt/lists/*
RUN echo 'alias ll="ls -l"' >> ~/.bashrc && echo 'alias la="ls -la"' >> ~/.bashrc
# add it locale
COPY locales.txt /etc/locale.gen
RUN locale-gen
# upgrade pip
RUN pip3 install --upgrade pip
# initialize app
RUN mkdir -p /app
WORKDIR /app
# install python requirements
COPY requirements.txt /app
RUN pip3 install -r requirements.txt
# production needs uwsgi
RUN pip3 install uwsgi
# remove gcc and builkd dependencies to keep image small
RUN apt-get purge -y --auto-remove gcc python-dev
# copy app
COPY . /app/
RUN rm /app/locales.txt
# create directory for the uwsgi spooler (if needed)
RUN mkdir -p /var/lib/uwsgi
Copyright (c) 2016, Guglielmo
All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
* Neither the name of Openpolis Sources Check nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Openpolis Sources Check
=============================
Webapp that facilitates the verification of a pool of sources..
See ``project/`` folder for this project's source code..
See ``docs/`` folder for a complete documentation of the project.
License
-------
See ``LICENSE.txt``
To see te authors of this project, open ``CONTRIBUTORS.txt``
FROM tutum/nginx
RUN rm /etc/nginx/sites-enabled/default
ADD sites-enabled/ /etc/nginx/sites-enabled
server {
listen 80;
server_name localhost senato2.staging.deppsviluppo.org;
charset utf-8;
client_max_body_size 64M;
location /static {
alias /app/public/static;
}
location /media {
alias /app/public/media;
}
location /data {
alias /app/data;
}
location / {
uwsgi_read_timeout 600;
proxy_read_timeout 300;
proxy_connect_timeout 300;
proxy_redirect off;
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-Proto $scheme;
uwsgi_pass web:8000;
include /etc/nginx/uwsgi_params;
}
}
FROM solr
MAINTAINER Guglielmo Celata "guglielmo@openpolis.it"
COPY config /opt/solr/server/solr/mycores/senatoragazzi/conf
COPY core.properties /opt/solr/server/solr/mycores/senatoragazzi/
USER root
RUN chown -R solr:solr /opt/solr/server/solr/mycores/senatoragazzi \
&& mkdir -p /opt/solr/server/solr/mycores/senatoragazzi/data \
&& chown -R solr:solr /opt/solr/server/solr/mycores/senatoragazzi/data \
&& mkdir -p /home/solr \
&& echo 'alias ll="ls -l"' >> /home/solr/.bashrc \
&& echo 'alias la="ls -la"' >> /home/solr/.bashrc \
&& chown -R solr:solr /home/solr
USER solr
CMD ["/opt/solr/bin/solr", "-f"]
# Set of Catalan contractions for ElisionFilter
# TODO: load this as a resource from the analyzer and sync it in build.xml
d
l
m
n
s
t
# Set of French contractions for ElisionFilter
# TODO: load this as a resource from the analyzer and sync it in build.xml
l
m
t
qu
n
s
j
d
c
jusqu
quoiqu
lorsqu
puisqu
# Set of Irish contractions for ElisionFilter
# TODO: load this as a resource from the analyzer and sync it in build.xml
d
m
b
# Set of Italian contractions for ElisionFilter
# TODO: load this as a resource from the analyzer and sync it in build.xml
c
l
all
dall
dell
nell
sull
coll
pell
gl
agl
dagl
degl
negl
sugl
un
m
t
s
v
d
# Set of Irish hyphenations for StopFilter
# TODO: load this as a resource from the analyzer and sync it in build.xml
h
n
t
# Set of overrides for the dutch stemmer
# TODO: load this as a resource from the analyzer and sync it in build.xml
fiets fiets
bromfiets bromfiets
ei eier
kind kinder
This diff is collapsed.
# This file was created by Jacques Savoy and is distributed under the BSD license.
# See http://members.unine.ch/jacques.savoy/clef/index.html.
# Also see http://www.opensource.org/licenses/bsd-license.html
# Cleaned on October 11, 2009 (not normalized, so use before normalization)
# This means that when modifying this list, you might need to add some
# redundant entries, for example containing forms with both أ and ا
من
ومن
منها
منه
في
وفي
فيها
فيه
و
ف
ثم
او
أو
ب
بها
به
ا
أ
اى
اي
أي
أى
لا
ولا
الا
ألا
إلا
لكن
ما
وما
كما
فما
عن
مع
اذا
إذا
ان
أن
إن
انها
أنها
إنها
انه
أنه
إنه
بان
بأن
فان
فأن
وان
وأن
وإن
التى
التي
الذى
الذي
الذين
الى
الي
إلى
إلي
على
عليها
عليه
اما
أما
إما
ايضا
أيضا
كل
وكل
لم
ولم
لن
ولن
هى
هي
هو
وهى
وهي
وهو
فهى
فهي
فهو
انت
أنت
لك
لها
له
هذه
هذا
تلك
ذلك
هناك
كانت
كان
يكون
تكون
وكانت
وكان
غير
بعض
قد
نحو
بين
بينما
منذ
ضمن
حيث
الان
الآن
خلال
بعد
قبل
حتى
عند
عندما
لدى
جميع
# This file was created by Jacques Savoy and is distributed under the BSD license.
# See http://members.unine.ch/jacques.savoy/clef/index.html.
# Also see http://www.opensource.org/licenses/bsd-license.html
а
аз
ако
ала
бе
без
беше
би
бил
била
били
било
близо
бъдат
бъде
бяха
в
вас
ваш
ваша
вероятно
вече
взема
ви
вие
винаги
все
всеки
всички
всичко
всяка
във
въпреки
върху
г
ги
главно
го
д
да
дали
до
докато
докога
дори
досега
доста
е
едва
един
ето
за
зад
заедно
заради
засега
затова
защо
защото
и
из
или
им
има
имат
иска
й
каза
как
каква
какво
както
какъв
като
кога
когато
което
които
кой
който
колко
която
къде
където
към
ли
м
ме
между
мен
ми
мнозина
мога
могат
може
моля
момента
му
н
на
над
назад
най
направи
напред
например
нас
не
него
нея
ни
ние
никой
нито
но
някои
някой
няма
обаче
около
освен
особено
от
отгоре
отново
още
пак
по
повече
повечето
под
поне
поради
после
почти
прави
пред
преди
през
при
пък
първо
с
са
само
се
сега
си
скоро
след
сме
според
сред
срещу
сте
съм
със
също
т
тази
така
такива
такъв
там
твой
те