Explorar o código

add the settings.yml.dist file

Olivier Massot %!s(int64=5) %!d(string=hai) anos
pai
achega
f9833fc53a
Modificáronse 2 ficheiros con 14 adicións e 14 borrados
  1. 6 1
      clonedb.py
  2. 8 13
      settings.yml.dist

+ 6 - 1
clonedb.py

@@ -56,8 +56,13 @@ LOG_MYSQL_QUERIES = DEBUG
 
 def load_settings():
     """ Load the settings from the 'settings.yml' file
+    If there is no such file, the base settings.yml file is created
     """
-    with open(HERE / 'settings.yml', 'r') as f:
+    settings_file = HERE / 'settings.yml'
+    if not settings_file.exists():
+        Path(HERE / 'settings.yml.dist').copy(HERE / 'settings.yml')
+
+    with open(settings_file, 'r') as f:
         return yaml.load(f, Loader=yaml.FullLoader)
 
 

+ 8 - 13
settings.yml → settings.yml.dist

@@ -1,20 +1,12 @@
 servers:
   docker:
-    host: localhost
+    host: docker:mariaDb
     description: Docker mariaDb
     mysql:
       port: 3306
       username: root
       password: mysql660
 
-  localhost:
-    host: localhost
-    description: Local Mysql
-    mysql:
-      port: 3305
-      username: root
-      password: mysql660
-
   preprod:
     host: preprod.2iopenservice.com
     description: Preprod
@@ -58,22 +50,21 @@ operations:
     from_server: preprod
     to_server: docker
     is_default: True
-    ignore_tables: []
-    ignore_views: []
-    structure_only: []
     compress: True
-#    filter_tables: []
 
   adminassos:
     dbname: adminassos
     from_server: preprod
     to_server: docker
+    is_default: True
+    compress: True
 
   openassos:
     dbname: openassos
     from_server: preprod
     to_server: docker
     is_default: True
+    compress: True
     ignore_tables: ['Access', 'matomo.*', 'user_piwik.*', 'zzz_.*', 'tt_content_save', 'tt_content_v59']
     structure_only: ['cf_cache_.*', 'sys_log']
 
@@ -81,6 +72,8 @@ operations:
     dbname: opentalent
     from_server: preprod
     to_server: docker
+    is_default: True
+    compress: True
     structure_only: []
     ignore_tables: ['Audit_.*']
     ignore_views: ['view_audit']
@@ -89,3 +82,5 @@ operations:
     dbname: metabase
     from_server: preprod
     to_server: docker
+    is_default: True
+    compress: True