Skip to content

Commit

Permalink
merge release/1.8
Browse files Browse the repository at this point in the history
  • Loading branch information
CI committed Dec 22, 2018
2 parents 8cf29bc + 8524de7 commit 455944b
Show file tree
Hide file tree
Showing 249 changed files with 6,539 additions and 2,192 deletions.
88 changes: 51 additions & 37 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ jobs:
build:
working_directory: ~/code
docker:
- image: circleci/python:3.6
- image: python:3.6.7-slim
environment:
PGHOST: 127.0.0.1
PIPENV_VENV_IN_PROJECT: 1
DATABASE_URL: "postgres://postgres:postgres@127.0.0.1:5432/etools_datamart"
DATABASE_URL: "postgis://postgres:postgres@127.0.0.1:5432/etools_datamart"
DATABASE_URL_ETOOLS: "postgis://postgres:postgres@127.0.0.1:5432/etools"
RELEASE_MATCH: "release/*"
- image: redis:alpine
- image: circleci/postgres:9.6-alpine-postgis
- image: mdillon/postgis:9.6
environment:
POSTGRES_USER: postgres
PGUSER: postgres
Expand All @@ -21,7 +21,21 @@ jobs:
- run:
name: Install dependencies
command: |
sudo apt-get update && sudo apt-get -y install postgresql
mkdir -p /usr/share/man/man1
mkdir -p /usr/share/man/man7
apt-get update
apt-get install -y \
libc-bin \
gcc \
curl \
gdal-bin \
python-dev \
postgresql-client-9.6
- run:
name: Create databases
command: |
createdb --user postgres etools
- restore_cache:
keys:
Expand All @@ -36,8 +50,8 @@ jobs:
command: |
export PATH=/home/circleci/.local/bin:$PATH
export PYTHONHASHSEED=${RANDOM}
pip install tox --user
tox -e py36-d21 deps
pip install tox
tox -e py36-d21
- run:
name: codecov
command: |
Expand All @@ -64,14 +78,14 @@ jobs:
- deploy:
name: tag and release if release candidate
command: |
if [[ $CIRCLE_BRANCH == $RELEASE_MATCH ]]; then
curl --user ${CIRCLE_TOKEN}: \
--data build_parameters[CIRCLE_JOB]=tag \
--data revision=$CIRCLE_SHA1 \
https://circleci.com/api/v1.1/project/github/$CIRCLE_PROJECT_USERNAME/$CIRCLE_PROJECT_REPONAME/tree/$CIRCLE_BRANCH
else
echo "Skipped as '$CIRCLE_BRANCH' does not match '$RELEASE_MATCH' branch"
fi
if [[ $CIRCLE_BRANCH == $RELEASE_MATCH ]]; then
curl --user ${CIRCLE_TOKEN}: \
--data build_parameters[CIRCLE_JOB]=tag \
--data revision=$CIRCLE_SHA1 \
https://circleci.com/api/v1.1/project/github/$CIRCLE_PROJECT_USERNAME/$CIRCLE_PROJECT_REPONAME/tree/$CIRCLE_BRANCH
else
echo "Skipped as '$CIRCLE_BRANCH' does not match '$RELEASE_MATCH' branch"
fi
tag:
docker:
- image: circleci/python:3.6
Expand Down Expand Up @@ -151,11 +165,11 @@ jobs:
- deploy:
name: dockerize
command: |
export TAG=${TAG:=${CIRCLE_BRANCH#*/}}
curl --user ${CIRCLE_TOKEN}: \
--data build_parameters[TAG]=$TAG \
--data build_parameters[JOB]=dockerize \
https://circleci.com/api/v1.1/project/github/$CIRCLE_PROJECT_USERNAME/$CIRCLE_PROJECT_REPONAME/tree/develop
export TAG=${TAG:=${CIRCLE_BRANCH#*/}}
curl --user ${CIRCLE_TOKEN}: \
--data build_parameters[TAG]=$TAG \
--data build_parameters[JOB]=dockerize \
https://circleci.com/api/v1.1/project/github/$CIRCLE_PROJECT_USERNAME/$CIRCLE_PROJECT_REPONAME/tree/develop
dockerize:
working_directory: ~/code
Expand Down Expand Up @@ -201,25 +215,25 @@ jobs:
- run:
name: Test Backend docker image
command: |
echo "Testing ${DOCKER_IMAGE}:${TAG}"
docker run -p 8000:8000 \
--rm \
-e DATABASE_URL=${DATABASE_URL} \
-e DEBUG=0 \
-e SECURE_SSL_REDIRECT=0 \
-e SESSION_COOKIE_SECURE=0 \
-e SESSION_COOKIE_HTTPONLY=9 \
-e SESSION_COOKIE_HTTPONLY=0 \
-e CSRF_COOKIE_SECURE=0 \
-it ${DOCKER_IMAGE}:${TAG} \
django-admin check --deploy
echo "Testing ${DOCKER_IMAGE}:${TAG}"
docker run -p 8000:8000 \
--rm \
-e DATABASE_URL=${DATABASE_URL} \
-e DEBUG=0 \
-e SECURE_SSL_REDIRECT=0 \
-e SESSION_COOKIE_SECURE=0 \
-e SESSION_COOKIE_HTTPONLY=9 \
-e SESSION_COOKIE_HTTPONLY=0 \
-e CSRF_COOKIE_SECURE=0 \
-it ${DOCKER_IMAGE}:${TAG} \
django-admin check --deploy
- deploy:
name: Push Backend docker image
command: |
echo "Pushing ${DOCKER_IMAGE}:${TAG} to Docker Hub"
export TODAY=`date '+%d %B %Y at %H:%M'`
echo "Pushing ${DOCKER_IMAGE}:${TAG} to Docker Hub"
export TODAY=`date '+%d %B %Y at %H:%M'`
docker login -u $DOCKER_USER -p $DOCKER_PASS
docker tag ${DOCKER_IMAGE}:${TAG} ${DOCKER_IMAGE}:latest
docker push ${DOCKER_IMAGE}:latest
docker push ${DOCKER_IMAGE}:${TAG}
docker login -u $DOCKER_USER -p $DOCKER_PASS
docker tag ${DOCKER_IMAGE}:${TAG} ${DOCKER_IMAGE}:latest
docker push ${DOCKER_IMAGE}:latest
docker push ${DOCKER_IMAGE}:${TAG}
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,5 @@ src/etools_datamart/apps/etools/models/public_old.py
src/etools_datamart/apps/etools/models/tenant_old.py
xml
~*
**/dual-listbox-master/
#src/etools_datamart/apps/security/static/security/dual-listbox-master
4 changes: 0 additions & 4 deletions .style.yapf

This file was deleted.

15 changes: 15 additions & 0 deletions CHANGES
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
1.8
---
* WARNINGS: migration reset
* add ability to create 'per model' custom templates for html/pdf renderers
new `TEMPLATE_CACHE_URL` enironment variable
* fixes error in some renderers with cached response
* Adopting of RabbitMQ to prevent message loss
* new admin index page
* Excel IQY support (beta)
* Allow endpoints to be consumend bny anonymous users
* Countries can be selected using name, schema_name,country_short_code or business_area_code
* Improved Browseable API
* `page_size` now accept `-1` to disable pagination


1.7
---
* WARNINGS: migration reset
Expand Down
20 changes: 10 additions & 10 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,6 @@ lint:
pipenv run pre-commit run --all-files
pipenv run pre-commit run --all-files --hook-stage push
pipenv run pre-commit run --all-files --hook-stage manual
# pipenv run flake8 src/ tests/
# pipenv run isort -rc src/ --check-only
# pipenv run check-manifest

clean:
rm -fr ${BUILDDIR} dist *.egg-info .coverage coverage.xml .eggs
Expand All @@ -59,14 +56,17 @@ urf:
pipenv run pytest tests/urf --cov-config tests/urf/.coveragerc


demo:
stack:
PYTHONPATH=./src pipenv run celery worker -A etools_datamart --loglevel=DEBUG --concurrency=4 --purge --pidfile celery.pid &
PYTHONPATH=./src pipenv run celery beat -A etools_datamart.celery --loglevel=DEBUG --pidfile beat.pid &
# PYTHONPATH=./src pipenv run gunicorn -b 0.0.0.0:8000 etools_datamart.config.wsgi --pid gunicorn.pid &
pipenv run docker run -d -p 5555:5555 -e CELERY_BROKER_URL=${CELERY_BROKER_URL} --name datamart-flower --rm saxix/flower

demo: stack
PYTHONPATH=./src pipenv run gunicorn -b 0.0.0.0:8000 etools_datamart.config.wsgi --pid gunicorn.pid &
pipenv run docker run -d -p 5555:5555 -e CELERY_BROKER_URL=$CELERY_BROKER_URL --name datamart-flower --rm saxix/flower

stop-demo:
- kill `cat gunicorn.pid`
- kill `cat beat.pid`
- kill `cat celery.pid`
- docker stop datamart-flower
demo-stop:
-kill `cat gunicorn.pid`
-kill `cat beat.pid`
-kill `cat celery.pid`
-docker stop datamart-flower
8 changes: 4 additions & 4 deletions Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ psycopg2 = "*"
admin-extra-urls = ">=2.1"
celery = "*"
coreapi = "*"
django = ">=2.1"
django = ">=2.1.4"
django-adminfilters = ">=1.1"
django-celery-beat = "==1.1.1"
django-concurrency = "*"
Expand All @@ -21,7 +21,6 @@ django-redis = "*"
django-regex = "*"
django-strategy-field = "*"
django-sysinfo = "*"
django-tenant-schemas = "*"
djangorestframework-csv = "*"
djangorestframework-jwt = "*"
drf-dynamic-serializer = ">=1.2.0"
Expand Down Expand Up @@ -50,12 +49,13 @@ djangorestframework-yaml = "*"
django-storages = {extras = ["azure"], version = "*"}
onedrivesdk = "*"
azure-storage = "*"
django-basicauth = "*"
django-post-office = "*"
django-celery-email = "*"
"xhtml2pdf" = "*"
pisa = "*"
django-crispy-forms = "*"
django-adminactions = "*"
django-dbtemplates = {file = "https://github.com/jazzband/django-dbtemplates/archive/2.0.1.tar.gz"}
django-mptt = "*"

[dev-packages]
"flake8" = ">=3.6.0"
Expand Down
Loading

0 comments on commit 455944b

Please sign in to comment.