diff --git a/README.md b/README.md index dc957a11d42141be123a1edd149bad698711dfec..2866dd96eb206c383fb10dab08e77731b96393fc 100644 --- a/README.md +++ b/README.md @@ -208,7 +208,7 @@ To overwrite the default settings for the Docker environment, add the relevant p "sql": { "tables": { "structure": ["cache", "cache_*", "history", "search_*", "sessions", "watchdog"], - "skip": ["none"] + "skip": ["migration_*"] } } }, @@ -360,8 +360,11 @@ alias cps "docker-compose ps" alias clogs "docker-compose logs" alias cstop "docker-compose stop" alias cstart "docker-compose start" -alias cshell "docker-compose exec -u root php sh" -alias cdrush "docker-compose exec -u root php drush" +alias cshell "docker-compose exec --user root php sh" +alias cdrush "docker-compose exec --user root php drush" +alias cdrush-pull "cdrush-pull-sql; and cdrush-pull-files" +alias cdrush-pull-sql "cdrush sql:sync --create-db @default.live @default.dev; and cdrush @default.dev cr; and cdrush @default.dev dev on" +alias cdrush-pull-files "cdrush rsync @default.live:%files/ @default.dev:%files -- --chown=www-data:www-data --safe-links --max-size=20M" ``` Do that once, it will pay back in a magnitude. diff --git a/src/Handler.php b/src/Handler.php index 781f5631358c6c5eea7cb393084fe091d911310c..f077c41bfce08324e2b6db731e9ff2887eadc3b0 100644 --- a/src/Handler.php +++ b/src/Handler.php @@ -225,8 +225,8 @@ class Handler { 'drushrc.php' => [ 'dest' => $projectRoot . '/drush', ], - '{{ projectname }}.alias.yml' => [ - 'dest' => $projectRoot . '/drush', + 'default.site.yml' => [ + 'dest' => $projectRoot . '/drush/sites', 'add2yaml' => TRUE, ], 'drush.yml' => [ @@ -269,7 +269,9 @@ class Handler { 'sessions', 'watchdog', ], - 'skip' => ['none'], + 'skip' => [ + 'migration_*', + ], ], ], ], diff --git a/templates/{{ projectname }}.alias.yml.twig b/templates/default.site.yml.twig similarity index 100% rename from templates/{{ projectname }}.alias.yml.twig rename to templates/default.site.yml.twig diff --git a/templates/drush.yml.twig b/templates/drush.yml.twig index 0553e3a8a982266eb2a794270b1e070490b3835b..f6dd53057028384411854cd92e9256a00827ad5d 100644 --- a/templates/drush.yml.twig +++ b/templates/drush.yml.twig @@ -1,19 +1,33 @@ drush: paths: + config: + - '${env.home}/.drush/config/drush.yml' include: - './drush/contrib' options: uri: 'http://{{ projectname }}.docker.localhost:8000' command: + core: + rsync: + options: + mode: 'rlDzq' sql: - options: - structure-tables: - common: + sync: + options: + structure-tables-key: 'common' + skip-tables: 'common' + dump: + options: + structure-tables-key: 'common' + skip-tables: 'common' +sql: + structure-tables: + common: {% for table in drush.sql.tables.structure %} - - '{{ table }}' + - '{{ table }}' {% endfor %} - skip-tables: - common: + skip-tables: + common: {% for table in drush.sql.tables.skip %} - - '{{ table }}' + - '{{ table }}' {% endfor %}