]> git.parisson.com Git - telemeta.git/commitdiff
Use 1.6.x image in prod, migration and bower install only at init, fix graphers listing
authorGuillaume Pellerin <guillaume.pellerin@ircam.fr>
Thu, 15 Feb 2018 14:17:47 +0000 (15:17 +0100)
committerGuillaume Pellerin <guillaume.pellerin@ircam.fr>
Thu, 15 Feb 2018 14:20:28 +0000 (15:20 +0100)
app/scripts/app.sh
docker-compose.yml
env/dev.yml
telemeta/views/item.py

index 887bb88fca04719a3b0d577b9088d00f926e5067..b8eb06a77282256d067a31805d8e905b20f6c389 100755 (executable)
@@ -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
index 71592a9ed854eacbc42f00a2304adb1014172deb..7905e09c4f2b9df77ad7ed897f92431658641f59 100644 (file)
@@ -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
index 887b74c0bf60b11339d4f9b418c2706a11cc284f..11c857e3aec3e25b300da514b1c7b92d42d9a1d7 100644 (file)
@@ -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
 
index 5434ef1b2aecac433746f53dc782070eb56db49a..e62eb62253ce1154c28286df068bd20699560bda 100644 (file)
@@ -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):