]> 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:17:47 +0000 (15:17 +0100)
app/scripts/app.sh
docker-compose.yml
env/dev.yml
telemeta/views/item.py

index ab2aba0e83eeaef2412bd8e93538657e58eb0fcf..efa8722007e999d9531868ee234cc7f3daa5542d 100644 (file)
@@ -12,7 +12,6 @@ src='/srv/src/'
 port=8000
 processes=8
 threads=8
-autoreload=3
 uid='www-data'
 gid='www-data'
 patterns='*.js;*.css;*.jpg;*.jpeg;*.gif;*.png;*.svg;*.ttf;*.eot;*.woff;*.woff2'
@@ -25,9 +24,13 @@ sh $app/scripts/wait.sh
 
 # django setup
 python $manage wait-for-db
-python $manage syncdb --noinput
-python $manage migrate --noinput
-python $manage bower_install -- --allow-root
+
+if [ ! -f .init ]; then
+    python $manage syncdb --noinput
+    python $manage migrate --noinput
+    python $manage bower_install -- --allow-root
+    touch .init
+fi
 
 # telemeta setup
 python $manage telemeta-create-admin-user
@@ -57,6 +60,5 @@ else
     # app start
     uwsgi --socket :$port --wsgi-file $wsgi --chdir $app --master \
         --processes $processes --threads $threads \
-        --uid $uid --gid $gid \
-        --py-autoreload $autoreload
+        --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 0afc82c4e6bbec4c7bc58b6a184a08e49ccf65e9..f892e50b93cdf9f41ba239110f7c15c99eff2b83 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 0cca438619754dde40297746b561fb22740b894e..e30081b3a7b505535cfe3c3decfc388b7011f0da 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):