]> git.parisson.com Git - mezzo.git/commitdiff
Use eve and presta in autonous compositions, add submodule init on pull
authorGuillaume Pellerin <guillaume.pellerin@ircam.fr>
Thu, 20 Oct 2016 11:08:52 +0000 (13:08 +0200)
committerGuillaume Pellerin <guillaume.pellerin@ircam.fr>
Thu, 20 Oct 2016 11:08:52 +0000 (13:08 +0200)
app/local_settings.py
app/organization/agenda/management/commands/organization-sync-prestashop-events.py
docker-compose.yml
env/eve.yml
env/prestashop.yml [new file with mode: 0644]
lib/mezzanine-agenda
scripts/pull.sh

index 1377d2ef39e901dcb78fba6c4260468c1194048a..0fd91cbf2d7873e067b5ae73ac45cfb6e300c71f 100644 (file)
@@ -19,26 +19,27 @@ DATABASES = {
         'HOST': 'db',
         'PORT': '5432',
     },
-    'eve': {
+}
+
+if os.environ.get('EVEDB_ENV_POSTGRES_PASSWORD'):
+    DATABASES['eve'] = {
         'ENGINE': 'django.db.backends.postgresql_psycopg2',
         'NAME': 'eve',
         'USER': 'eve',
-        'PASSWORD': "q2nqzt0WGnwWé,256",
+        'PASSWORD': os.environ.get('EVEDB_ENV_POSTGRES_PASSWORD'),
         'HOST': 'evedb',
         'PORT': '5432',
-    },
-    'prestashop': {
+    }
+
+if os.environ.get('PRESTADB_ENV_MYSQL_PASSWORD'):
+    DATABASES['prestashop'] = {
         'ENGINE': 'django.db.backends.mysql',  # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'.
         'USER': 'ircam_shops',      # Not used with sqlite3.
-        'PASSWORD': 'pUmt97e4MgR9EP4knyWea0n',  # Not used with sqlite3.
+        'PASSWORD': os.environ.get('PRESTADB_ENV_MYSQL_PASSWORD'),  # Not used with sqlite3.
         'NAME': 'ircam_shops',
         'HOST': 'prestadb',      # Set to empty string for localhost. Not used with sqlite3.
         'PORT': '3306',      # Set to empty string for default. Not used with sqlite3.
-    }
-
-}
-
-# DATABASE_ROUTERS = ['eve.routers.EveRouter',]
+        }
 
 
 # EXTENSIONS AND FORMATS
index bc781bcad21174734e88f95831af39dea41306f1..c2984f81999fcfd7e271dee6d1ca1abaedfc41bd 100644 (file)
@@ -34,7 +34,8 @@ class Command(BaseCommand):
              event.delete()
 
     def handle(self, *args, **kwargs):
-        self.cleanup()
+        # !! NOT FOR PROD !!
+        # self.cleanup()
 
         products = []
         category_lang_name = kwargs.get('category_lang_name')
index 0d6ac496c8d87bf01ead0c5ac2f6a47e8c3a1d90..66e895aa2c70fdf56acda0202acf39aa520bcb6a 100644 (file)
@@ -38,31 +38,6 @@ db:
   environment:
     - POSTGRES_PASSWORD=hyRob0otlaz4
 
-prestadb:
-  image: mariadb
-  volumes_from:
-    - data
-  volumes:
-    - ./scripts/:/srv/scripts
-    - ./data/external/prestashop/mysql/:/var/lib/mysql
-  environment:
-    - MYSQL_ROOT_PASSWORD=mysecretpassword
-    - MYSQL_DATABASE=ircam_shops
-    - MYSQL_USER=ircam_shops
-    - MYSQL_PASSWORD=pUmt97e4MgR9EP4knyWea0n
-
-evedb:
-  image: postgres:9.5
-  volumes_from:
-    - data
-  volumes:
-    - ./scripts/:/srv/scripts
-    - ./data/external/eve/postgresql/data/:/var/lib/postgresql/data
-  environment:
-    - POSTGRES_USER=eve
-    - POSTGRES_DB=eve
-    - POSTGRES_PASSWORD=q2nqzt0WGnwWé,256
-
 app:
   build: .
   command: /bin/bash scripts/app.sh
@@ -70,7 +45,7 @@ app:
     - ./app/:/srv/app
     - ./lib/grappelli-safe/:/srv/lib/grappelli-safe
     - ./lib/mezzanine-agenda/:/srv/lib/mezzanine-agenda
-    - ./lib/mezzanine/:/srv/lib/mezzanine
+    - ./lib/mezzanine/:/srv/lib/mezzanine
     - ./lib/django-eve/:/srv/lib/django-eve
     - ./lib/django-prestashop/:/srv/lib/django-prestashop
   volumes_from:
@@ -79,8 +54,6 @@ app:
     - "8000"
   links:
     - db
-    - prestadb
-    - evedb
   environment:
    - DEBUG=False
 
index 8190bff5cc5743b1ba1224359cfff5c80ba21e66..3bce54cc25b9d5bcdd4ddaa0427560c03c15cafa 100644 (file)
@@ -1,4 +1,4 @@
-    # -*- coding: utf-8 -*-
+# -*- coding: utf-8 -*-
 #
 # Copyright (c) 2015 Guillaume Pellerin <guillaume.pellerin@ircam.fr>
 
 # Authors:
 # Guillaume Pellerin <guillaume.pellerin@ircam.fr>
 
+
 evedb:
-  image: postgres
-  volumes:
-    - ./data/var/lib/postgresql/eve/data/:/var/lib/postgresql/data
+  image: postgres:9.5
   volumes_from:
     - data
+  volumes:
+    - ./scripts/:/srv/scripts
+    - ./data/external/eve/postgresql/data/:/var/lib/postgresql/data
   environment:
-    - POSTGRES_PASSWORD=mysecretpassword
-    - POSTGRES_USER=postgres
+    - POSTGRES_USER=eve
     - POSTGRES_DB=eve
+    - POSTGRES_PASSWORD=q2nqzt0WGnwWé,256
+    
+app:
+  links:
+    - db
+    - evedb
diff --git a/env/prestashop.yml b/env/prestashop.yml
new file mode 100644 (file)
index 0000000..d371047
--- /dev/null
@@ -0,0 +1,38 @@
+# -*- coding: utf-8 -*-
+#
+# Copyright (c) 2015 Guillaume Pellerin <guillaume.pellerin@ircam.fr>
+
+# Manifeste is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 2 of the License, or
+# (at your option) any later version.
+
+# Manifeste is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with Manifeste.  If not, see <http://www.gnu.org/licenses/>.
+
+# Authors:
+# Guillaume Pellerin <guillaume.pellerin@ircam.fr>
+
+
+prestadb:
+  image: mariadb
+  volumes_from:
+    - data
+  volumes:
+    - ./scripts/:/srv/scripts
+    - ./data/external/prestashop/mysql/:/var/lib/mysql
+  environment:
+    - MYSQL_ROOT_PASSWORD=mysecretpassword
+    - MYSQL_DATABASE=ircam_shops
+    - MYSQL_USER=ircam_shops
+    - MYSQL_PASSWORD=pUmt97e4MgR9EP4knyWea0n
+
+app:
+  links:
+    - db
+    - prestadb
index 2c6e15e6a66c507e05ab803016acd4d250f4d2dd..d975b0c2dde27b3cedc93016f5aaafd345d35d60 160000 (submodule)
@@ -1 +1 @@
-Subproject commit 2c6e15e6a66c507e05ab803016acd4d250f4d2dd
+Subproject commit d975b0c2dde27b3cedc93016f5aaafd345d35d60
index bd4b4f44f4c9814074c9f53cf0d858db2e735899..a6e290febd05e0857f9548659ed57caf5ea7e177 100755 (executable)
@@ -3,5 +3,6 @@
 sudo chown -R $USER data/media
 sudo chown -R $USER data/backup
 git pull
-git submodule foreach git pull origin master
+git submodule update --init --recursive
+git submodule foreach git pull
 docker-compose run db /srv/scripts/restore_db.sh