From 2bb40a57f4a8f0e0873bb4db7b7656bc583d6058 Mon Sep 17 00:00:00 2001 From: Alex Moreno-Lopez Date: Mon, 4 Jul 2022 18:28:59 +0200 Subject: [PATCH 1/2] Added example of db import when creating a new site from the UI --- db_import_new_site/README.md | 42 +++++++++++++++++++++++ db_import_new_site/db_import_new_site.php | 10 ++++++ 2 files changed, 52 insertions(+) create mode 100644 db_import_new_site/README.md create mode 100644 db_import_new_site/db_import_new_site.php diff --git a/db_import_new_site/README.md b/db_import_new_site/README.md new file mode 100644 index 0000000..ab45d83 --- /dev/null +++ b/db_import_new_site/README.md @@ -0,0 +1,42 @@ +# Database sanitization of user emails and passwords. # + +This example will show you how you can automatically import a database when creating a new site from the UI. + +The use case is multiple, but imagine for example building a microsite distribution, where + +Use cases: + +- Automation of microsites +- Automation of branding sites +- Automation of regional sites +- Others? + +## Instructions ## + +Setting up this example is easy: + +1. Add either the db_import_new_site to the `private` directory of your code repository. +2. Add a Quicksilver operation to your `pantheon.yml` to fire the script spining up a new site. +3. Commit and push changes to your repository +4. Test creating a new site out of the current upstream codebase! + +Optionally, you may want to use the `terminus workflow:watch yoursitename` command to get immediate debugging feedback. + +### Example `pantheon.yml` ### + +Here's an example of what your `pantheon.yml` would look like if this were the only Quicksilver operation you wanted to use: + +```yaml + +api_version: 1 +workflows: + deploy_product: + after: + - type: webphp + description: Run drush deploy new site creation in dev + script: private/scripts/new_site.php +``` + +### TODO ### + +Use a similar example executing config import/export for an approach following best practices diff --git a/db_import_new_site/db_import_new_site.php b/db_import_new_site/db_import_new_site.php new file mode 100644 index 0000000..67d74d6 --- /dev/null +++ b/db_import_new_site/db_import_new_site.php @@ -0,0 +1,10 @@ + Date: Mon, 4 Jul 2022 18:31:53 +0200 Subject: [PATCH 2/2] added example script. --- db_import_new_site/db_import_new_site.php | 29 ++++++++++++++++------- 1 file changed, 20 insertions(+), 9 deletions(-) diff --git a/db_import_new_site/db_import_new_site.php b/db_import_new_site/db_import_new_site.php index 67d74d6..83fdc6e 100644 --- a/db_import_new_site/db_import_new_site.php +++ b/db_import_new_site/db_import_new_site.php @@ -1,10 +1,21 @@