From: Guillaume Pellerin Date: Thu, 15 Feb 2018 14:17:47 +0000 (+0100) Subject: Use 1.6.x image in prod, migration and bower install only at init, fix graphers listing X-Git-Tag: 1.7.0~2^2~4^2~18 X-Git-Url: https://git.parisson.com/?a=commitdiff_plain;h=b1352931bf8ea3cd42bb1c46c0a23be13da1a754;p=telemeta.git Use 1.6.x image in prod, migration and bower install only at init, fix graphers listing --- diff --git a/app/scripts/app.sh b/app/scripts/app.sh index 887bb88f..b8eb06a7 100755 --- a/app/scripts/app.sh +++ b/app/scripts/app.sh @@ -13,7 +13,6 @@ log='/var/log/uwsgi/app.log' port=8000 processes=8 threads=8 -autoreload=3 uid='www-data' gid='www-data' @@ -27,8 +26,12 @@ pip install -e git+https://github.com/Parisson/saved_searches.git@dj1.8#egg=save # waiting for other network services sh $app/scripts/wait.sh python $manage wait-for-db -python $manage migrate --noinput -python $manage bower_install -- --allow-root + +if [ ! -f .init ]; then + python $manage migrate --noinput + python $manage bower_install -- --allow-root + touch .init +fi # telemeta setup python $manage telemeta-create-admin-user @@ -57,7 +60,6 @@ else # app start uwsgi --socket :$port --wsgi-file $wsgi --chdir $app --master \ - --processes $processes --threads $threads \ - --uid $uid --gid $gid --logto $log --touch-reload $wsgi - + --processes $processes --threads $threads \ + --uid $uid --gid $gid fi diff --git a/docker-compose.yml b/docker-compose.yml index 71592a9e..7905e09c 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -50,7 +50,7 @@ search: image: elasticsearch:1 app: - image: parisson/telemeta:latest + image: parisson/telemeta:1.6.x volumes: - ./app:/srv/app - ./telemeta:/srv/src/telemeta/telemeta @@ -65,7 +65,7 @@ app: - search worker: - image: parisson/telemeta:latest + image: parisson/telemeta:1.6.x volumes_from: - app - data diff --git a/env/dev.yml b/env/dev.yml index 887b74c0..11c857e3 100644 --- a/env/dev.yml +++ b/env/dev.yml @@ -23,7 +23,7 @@ app: - image: image: parisson/telemeta:latest-dev + image: parisson/telemeta:latest env_file: - env/debug.env command: /bin/bash scripts/app.sh --runserver @@ -31,7 +31,7 @@ app: - 9000:8000 worker: - image: image: parisson/telemeta:latest-dev + image: parisson/telemeta:latest env_file: - env/debug.env diff --git a/telemeta/views/item.py b/telemeta/views/item.py index 5434ef1b..e62eb622 100644 --- a/telemeta/views/item.py +++ b/telemeta/views/item.py @@ -55,16 +55,14 @@ class ItemBaseMixin(TelemetaBaseMixin): graphers_access = (user.is_staff or user.is_superuser or user.has_perm('telemeta.can_run_analysis')) - for grapher in self.graphers: if (graphers_access or grapher.id() in self.public_graphers): - continue - if grapher.id() == self.default_grapher_id: - graphers.insert(0, {'name': grapher.name(), 'id': grapher.id()}) - elif not hasattr(grapher, '_staging'): - graphers.append({'name': grapher.name(), 'id': grapher.id()}) - elif not grapher._staging: - graphers.append({'name': grapher.name(), 'id': grapher.id()}) + if grapher.id() == self.default_grapher_id: + graphers.insert(0, {'name': grapher.name(), 'id': grapher.id()}) + elif not hasattr(grapher, '_staging'): + graphers.append({'name': grapher.name(), 'id': grapher.id()}) + elif not grapher._staging: + graphers.append({'name': grapher.name(), 'id': grapher.id()}) return graphers def get_grapher(self, id):