diff --git a/.env b/.env index e3570f629..aa71233a8 100644 --- a/.env +++ b/.env @@ -113,6 +113,13 @@ VORTEX_PROVISION_TYPE=database # Set this to 1 in .env.local to override when developing locally. VORTEX_PROVISION_OVERRIDE_DB=0 +# Fallback to profile installation if the database dump is not available. +# +# When enabled and the provision type is set to "database", the site will be +# installed from the profile if the database dump file or container image +# is not available. +VORTEX_PROVISION_FALLBACK_TO_PROFILE=0 + # Skip database sanitization. # # Database sanitization is enabled by default in all non-production diff --git a/.vortex/docs/content/development/variables.mdx b/.vortex/docs/content/development/variables.mdx index 63cc95228..cd1f9865a 100644 --- a/.vortex/docs/content/development/variables.mdx +++ b/.vortex/docs/content/development/variables.mdx @@ -389,6 +389,7 @@ The list below is automatically generated with [Shellvar](https://github.com/ale | `VORTEX_PROVISION_DB_DIR` | Directory with database dump file. | `./.data` | `scripts/vortex/provision.sh` | | `VORTEX_PROVISION_DB_FILE` | Database dump file name. | `db.sql` | `scripts/vortex/provision.sh` | | `VORTEX_PROVISION_DB_IMAGE` | Name of the pre-built database container image. | `${VORTEX_DB_IMAGE}` | `scripts/vortex/provision.sh` | +| `VORTEX_PROVISION_FALLBACK_TO_PROFILE` | Fallback to profile installation if the database dump is not available.

When enabled and the provision type is set to "database", the site will be installed from the profile if the database dump file or container image is not available. | `UNDEFINED` | `.env`, `scripts/vortex/provision.sh` | | `VORTEX_PROVISION_OVERRIDE_DB` | Overwrite a database if it exists.

Usually set to `0` in deployed environments and can be temporary set to `1` for a specific deployment. Set this to `1` in .env.local to override when developing locally. | `UNDEFINED` | `.env`, `.env.local.example`, `scripts/vortex/provision.sh` | | `VORTEX_PROVISION_POST_OPERATIONS_SKIP` | Flag to skip running of operations after site provision is complete. Useful to only import the database from file (or install from profile) and not perform any additional operations. For example, when need to capture database state before any updates ran (for example, DB caching in CI). | `0` | `scripts/vortex/provision.sh` | | `VORTEX_PROVISION_SANITIZE_DB_ADDITIONAL_FILE` | Path to file with custom sanitization SQL queries.

To skip custom sanitization, remove the file defined in VORTEX_PROVISION_SANITIZE_DB_ADDITIONAL_FILE variable from the codebase. | `./scripts/sanitize.sql` | `scripts/vortex/provision-sanitize-db.sh` | diff --git a/.vortex/docs/content/drupal/provision.mdx b/.vortex/docs/content/drupal/provision.mdx index c182c2e89..f10fd28f1 100644 --- a/.vortex/docs/content/drupal/provision.mdx +++ b/.vortex/docs/content/drupal/provision.mdx @@ -93,21 +93,70 @@ conditions that could alter the execution path. The numbered steps refer to the environment variables described in the next section. - - Provision flow - Provision flow - +```text +πŸš€ Start + β”‚ +β‘  πŸ’‘ Skip provision? ──Yes──► 🏁 End + β”‚ No + β–Ό +β‘‘ πŸ’‘ Provision type = database +β”‚ +β”œβ”€ πŸ’‘ Existing site found = YES +β”‚ β”œβ”€ Container image set? ──► preserve content (no change) +β”‚ β”œβ”€ β‘’ Overwrite DB? ──Yes──► πŸ—‘οΈ Drop DB ──► πŸ›’οΈ Attempt import from dump +β”‚ β”‚ β”‚ +β”‚ β”‚ β”œβ”€ Dump file exists? ──► πŸ›’οΈ Import DB +β”‚ β”‚ └─ Dump file missing? +β”‚ β”‚ β”œβ”€ β‘£ Fallback? ──Yes──► πŸ“¦ Install from profile βœ“ +β”‚ β”‚ └─ β‘£ Fallback? ──No───► 🏁 EXIT 1 (fail) βœ— +β”‚ └─ else ──► preserve content, ⑦ skip sanitization +β”‚ +└─ πŸ’‘ Existing site found = NO + β”œβ”€ Container image set? + β”‚ β”œβ”€ β‘£ Fallback? ──Yes──► πŸ“¦ Install from profile βœ“ + β”‚ └─ β‘£ Fallback? ──No───► 🏁 EXIT 1 ("corrupted image") βœ— + └─ Container image not set? ──► πŸ—‘οΈ Drop DB ──► πŸ›’οΈ Attempt import from dump + β”‚ + β”œβ”€ Dump file exists? ──► πŸ›’οΈ Import DB + └─ Dump file missing? + β”œβ”€ β‘£ Fallback? ──Yes──► πŸ“¦ Install from profile βœ“ + └─ β‘£ Fallback? ──No───► 🏁 EXIT 1 (fail) βœ— + +── after provisioning (both DB and profile paths) ── + +β‘€ πŸ’‘ Skip other operations? ──Yes──► 🏁 End + β”‚ No + β–Ό +β‘₯ 🚧 Enable maintenance mode + β–Ό + ⬇️ Import configuration + β–Ό + πŸ”„ Run DB updates + β–Ό + 🧹 Rebuild caches + β–Ό + πŸ”„ Run deployment operations + β–Ό +⑦ 😷 Run DB sanitization + β–Ό + βš™οΈ Run custom scripts + β–Ό +β‘₯ 🚧 Disable maintenance mode + β–Ό + 🏁 End +``` ### Customizing flow You can control the provisioning flow using the following environment variables: 1. `VORTEX_PROVISION_SKIP=1`
Kill-switch to completely skip provisioning. The script will exit immediately after start. Useful in emergencies when any kind of automation needs to be disabled.

-2. `VORTEX_PROVISION_OVERRIDE_DB=1`
Drop an existing database before importing from dump/installing from profile. This is useful when an already provisioned environment requires a fresh database to be imported.

-3. `VORTEX_PROVISION_TYPE=profile`
Install from a Drupal `profile` instead of importing from a `database` dump. Useful for building sites without the persistent DB and/or test profile configuration installation.

-4. `VORTEX_PROVISION_POST_OPERATIONS_SKIP=1`
Skip configuration imports, database updates, and other post-provisioning steps. Essentially, this is `drush sql:drop` and `$(drush sql:connect) < .data/db.sql` commands. This is useful when you want to provision a site without running any additional operations.
`ahoy import-db` uses this flag to import DB and exit.

-5. `VORTEX_PROVISION_USE_MAINTENANCE_MODE=1`
Enable maintenance mode right after the site is bootstrappable and disable it at the end. Useful when you want to prevent users from accessing the site while it is being provisioned.

-6. `VORTEX_PROVISION_SANITIZE_DB_SKIP=1`
Disable database sanitization. +2. `VORTEX_PROVISION_TYPE=profile`
Install from a Drupal `profile` instead of importing from a `database` dump. Useful for building sites without the persistent DB and/or test profile configuration installation.

+3. `VORTEX_PROVISION_OVERRIDE_DB=1`
Drop an existing database before importing from dump/installing from profile. This is useful when an already provisioned environment requires a fresh database to be imported.

+4. `VORTEX_PROVISION_FALLBACK_TO_PROFILE=1`
Automatically fall back to installing from profile if the database dump file or container image is not available. Useful for distribution demos or when using recipes/profiles that can install without a pre-existing database.

+5. `VORTEX_PROVISION_POST_OPERATIONS_SKIP=1`
Skip configuration imports, database updates, and other post-provisioning steps. Essentially, this is `drush sql:drop` and `$(drush sql:connect) < .data/db.sql` commands. This is useful when you want to provision a site without running any additional operations.
`ahoy import-db` uses this flag to import DB and exit.

+6. `VORTEX_PROVISION_USE_MAINTENANCE_MODE=1`
Enable maintenance mode right after the site is bootstrappable and disable it at the end. Useful when you want to prevent users from accessing the site while it is being provisioned.

+7. `VORTEX_PROVISION_SANITIZE_DB_SKIP=1`
Disable database sanitization. :::tip diff --git a/.vortex/docs/static/img/diagram-provision-dark.svg b/.vortex/docs/static/img/diagram-provision-dark.svg deleted file mode 100644 index 209ef3cda..000000000 --- a/.vortex/docs/static/img/diagram-provision-dark.svg +++ /dev/null @@ -1,4 +0,0 @@ - - - -
Β  Β Standard operations
Β  Β Standard operations
πŸš€ Start
πŸš€ Start
πŸ’‘ Skip provision?Β 
πŸ’‘ Skip provision?Β 
πŸ’‘ Can bootstrap?
πŸ’‘ Can bootstrap?
🏁 End
🏁 End
πŸ’‘ Override DB?Β Β 
πŸ’‘ Override DB?Β Β 
Site is bootstrappable
πŸ—‘οΈ Drop DB
πŸ—‘οΈ Drop DB
πŸ’‘ Use DB dump
or profile?
πŸ’‘ Use DB dump...
πŸ›’οΈ Import from DB dump
πŸ›’οΈ Import from DB dump
πŸ“¦ Install from profile
πŸ“¦ Install from profile
πŸ’‘ Skip other operations?Β 
πŸ’‘ Skip other operations?Β 
🚧 Enable maintenance mode 
🚧 Enable maintenance mode 
🏁 End
🏁 End
⬇️ Import configuration
⬇️ Import configuration
πŸ”„ Run DB updates
πŸ”„ Run DB updates
🧹 Rebuild caches
🧹 Rebuild caches
πŸ”„ Run deployment operations
πŸ”„ Run deployment operations
😷 Run DB sanitization 
😷 Run DB sanitization 
βš™οΈ Run custom scripts
βš™οΈ Run custom scripts
🚧 Disable maintenance mode
🚧 Disable maintenance mode
🏁 End
🏁 End
NoYesYesNoPreserve existing DBYesDB dumpProfileNoNoYes
1
1
2
2
3
3
4
4
5
5
6
6
Text is not SVG - cannot display
\ No newline at end of file diff --git a/.vortex/docs/static/img/diagram-provision-light.svg b/.vortex/docs/static/img/diagram-provision-light.svg deleted file mode 100644 index 209ef3cda..000000000 --- a/.vortex/docs/static/img/diagram-provision-light.svg +++ /dev/null @@ -1,4 +0,0 @@ - - - -
Β  Β Standard operations
Β  Β Standard operations
πŸš€ Start
πŸš€ Start
πŸ’‘ Skip provision?Β 
πŸ’‘ Skip provision?Β 
πŸ’‘ Can bootstrap?
πŸ’‘ Can bootstrap?
🏁 End
🏁 End
πŸ’‘ Override DB?Β Β 
πŸ’‘ Override DB?Β Β 
Site is bootstrappable
πŸ—‘οΈ Drop DB
πŸ—‘οΈ Drop DB
πŸ’‘ Use DB dump
or profile?
πŸ’‘ Use DB dump...
πŸ›’οΈ Import from DB dump
πŸ›’οΈ Import from DB dump
πŸ“¦ Install from profile
πŸ“¦ Install from profile
πŸ’‘ Skip other operations?Β 
πŸ’‘ Skip other operations?Β 
🚧 Enable maintenance mode 
🚧 Enable maintenance mode 
🏁 End
🏁 End
⬇️ Import configuration
⬇️ Import configuration
πŸ”„ Run DB updates
πŸ”„ Run DB updates
🧹 Rebuild caches
🧹 Rebuild caches
πŸ”„ Run deployment operations
πŸ”„ Run deployment operations
😷 Run DB sanitization 
😷 Run DB sanitization 
βš™οΈ Run custom scripts
βš™οΈ Run custom scripts
🚧 Disable maintenance mode
🚧 Disable maintenance mode
🏁 End
🏁 End
NoYesYesNoPreserve existing DBYesDB dumpProfileNoNoYes
1
1
2
2
3
3
4
4
5
5
6
6
Text is not SVG - cannot display
\ No newline at end of file diff --git a/.vortex/installer/tests/Fixtures/handler_process/_baseline/.env b/.vortex/installer/tests/Fixtures/handler_process/_baseline/.env index 6600d69ab..a85067fb3 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/_baseline/.env +++ b/.vortex/installer/tests/Fixtures/handler_process/_baseline/.env @@ -103,6 +103,13 @@ VORTEX_PROVISION_TYPE=database # Set this to 1 in .env.local to override when developing locally. VORTEX_PROVISION_OVERRIDE_DB=0 +# Fallback to profile installation if the database dump is not available. +# +# When enabled and the provision type is set to "database", the site will be +# installed from the profile if the database dump file or container image +# is not available. +VORTEX_PROVISION_FALLBACK_TO_PROFILE=0 + # Skip database sanitization. # # Database sanitization is enabled by default in all non-production diff --git a/.vortex/installer/tests/Fixtures/handler_process/db_download_source_acquia/.env b/.vortex/installer/tests/Fixtures/handler_process/db_download_source_acquia/.env index d8fb2801f..b054eafb4 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/db_download_source_acquia/.env +++ b/.vortex/installer/tests/Fixtures/handler_process/db_download_source_acquia/.env @@ -1,4 +1,4 @@ -@@ -142,13 +142,8 @@ +@@ -149,13 +149,8 @@ VORTEX_DB_FILE=db.sql # Database download source. @@ -13,7 +13,7 @@ # Environment to download the database from. # # Applies to hosting environments. -@@ -199,17 +194,3 @@ +@@ -206,17 +201,3 @@ # with optional names in the format "email|name". # Example: "to1@example.com|Jane Doe, to2@example.com|John Doe" VORTEX_NOTIFY_EMAIL_RECIPIENTS="webmaster@star-wars.com|Webmaster" diff --git a/.vortex/installer/tests/Fixtures/handler_process/db_download_source_container_registry/.env b/.vortex/installer/tests/Fixtures/handler_process/db_download_source_container_registry/.env index f54bd976a..15e629ddb 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/db_download_source_container_registry/.env +++ b/.vortex/installer/tests/Fixtures/handler_process/db_download_source_container_registry/.env @@ -1,4 +1,4 @@ -@@ -142,12 +142,11 @@ +@@ -149,12 +149,11 @@ VORTEX_DB_FILE=db.sql # Database download source. @@ -15,7 +15,7 @@ # Environment to download the database from. # -@@ -199,17 +198,3 @@ +@@ -206,17 +205,3 @@ # with optional names in the format "email|name". # Example: "to1@example.com|Jane Doe, to2@example.com|John Doe" VORTEX_NOTIFY_EMAIL_RECIPIENTS="webmaster@star-wars.com|Webmaster" diff --git a/.vortex/installer/tests/Fixtures/handler_process/db_download_source_ftp/.env b/.vortex/installer/tests/Fixtures/handler_process/db_download_source_ftp/.env index c9bde7fec..ffc765d4e 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/db_download_source_ftp/.env +++ b/.vortex/installer/tests/Fixtures/handler_process/db_download_source_ftp/.env @@ -1,4 +1,4 @@ -@@ -142,13 +142,19 @@ +@@ -149,13 +149,19 @@ VORTEX_DB_FILE=db.sql # Database download source. @@ -23,7 +23,7 @@ # Environment to download the database from. # # Applies to hosting environments. -@@ -199,17 +205,3 @@ +@@ -206,17 +212,3 @@ # with optional names in the format "email|name". # Example: "to1@example.com|Jane Doe, to2@example.com|John Doe" VORTEX_NOTIFY_EMAIL_RECIPIENTS="webmaster@star-wars.com|Webmaster" diff --git a/.vortex/installer/tests/Fixtures/handler_process/db_download_source_lagoon/.env b/.vortex/installer/tests/Fixtures/handler_process/db_download_source_lagoon/.env index 0d65b4bfb..cc996d11b 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/db_download_source_lagoon/.env +++ b/.vortex/installer/tests/Fixtures/handler_process/db_download_source_lagoon/.env @@ -1,4 +1,4 @@ -@@ -142,13 +142,8 @@ +@@ -149,13 +149,8 @@ VORTEX_DB_FILE=db.sql # Database download source. @@ -13,7 +13,7 @@ # Environment to download the database from. # # Applies to hosting environments. -@@ -199,17 +194,3 @@ +@@ -206,17 +201,3 @@ # with optional names in the format "email|name". # Example: "to1@example.com|Jane Doe, to2@example.com|John Doe" VORTEX_NOTIFY_EMAIL_RECIPIENTS="webmaster@star-wars.com|Webmaster" diff --git a/.vortex/installer/tests/Fixtures/handler_process/db_download_source_s3/.env b/.vortex/installer/tests/Fixtures/handler_process/db_download_source_s3/.env index b6bac3a4d..3b8c10bdf 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/db_download_source_s3/.env +++ b/.vortex/installer/tests/Fixtures/handler_process/db_download_source_s3/.env @@ -1,4 +1,4 @@ -@@ -142,13 +142,16 @@ +@@ -149,13 +149,16 @@ VORTEX_DB_FILE=db.sql # Database download source. @@ -20,7 +20,7 @@ # Environment to download the database from. # # Applies to hosting environments. -@@ -199,17 +202,3 @@ +@@ -206,17 +209,3 @@ # with optional names in the format "email|name". # Example: "to1@example.com|Jane Doe, to2@example.com|John Doe" VORTEX_NOTIFY_EMAIL_RECIPIENTS="webmaster@star-wars.com|Webmaster" diff --git a/.vortex/installer/tests/Fixtures/handler_process/deploy_types_all_circleci/.env b/.vortex/installer/tests/Fixtures/handler_process/deploy_types_all_circleci/.env index 43a0cb4ef..309a11f73 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/deploy_types_all_circleci/.env +++ b/.vortex/installer/tests/Fixtures/handler_process/deploy_types_all_circleci/.env @@ -1,4 +1,4 @@ -@@ -172,7 +172,7 @@ +@@ -179,7 +179,7 @@ # Deployment occurs when tests pass in the CI environment. # @see https://www.vortextemplate.com/docs/deployment diff --git a/.vortex/installer/tests/Fixtures/handler_process/deploy_types_all_gha/.env b/.vortex/installer/tests/Fixtures/handler_process/deploy_types_all_gha/.env index 43a0cb4ef..309a11f73 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/deploy_types_all_gha/.env +++ b/.vortex/installer/tests/Fixtures/handler_process/deploy_types_all_gha/.env @@ -1,4 +1,4 @@ -@@ -172,7 +172,7 @@ +@@ -179,7 +179,7 @@ # Deployment occurs when tests pass in the CI environment. # @see https://www.vortextemplate.com/docs/deployment diff --git a/.vortex/installer/tests/Fixtures/handler_process/deploy_types_artifact/.env b/.vortex/installer/tests/Fixtures/handler_process/deploy_types_artifact/.env index 43e40213f..bba4458d7 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/deploy_types_artifact/.env +++ b/.vortex/installer/tests/Fixtures/handler_process/deploy_types_artifact/.env @@ -1,4 +1,4 @@ -@@ -172,7 +172,7 @@ +@@ -179,7 +179,7 @@ # Deployment occurs when tests pass in the CI environment. # @see https://www.vortextemplate.com/docs/deployment diff --git a/.vortex/installer/tests/Fixtures/handler_process/deploy_types_container_image/.env b/.vortex/installer/tests/Fixtures/handler_process/deploy_types_container_image/.env index 907c7a7ee..0afc60758 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/deploy_types_container_image/.env +++ b/.vortex/installer/tests/Fixtures/handler_process/deploy_types_container_image/.env @@ -1,4 +1,4 @@ -@@ -172,7 +172,7 @@ +@@ -179,7 +179,7 @@ # Deployment occurs when tests pass in the CI environment. # @see https://www.vortextemplate.com/docs/deployment diff --git a/.vortex/installer/tests/Fixtures/handler_process/deploy_types_lagoon/.env b/.vortex/installer/tests/Fixtures/handler_process/deploy_types_lagoon/.env index 44ac598c2..85d59a171 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/deploy_types_lagoon/.env +++ b/.vortex/installer/tests/Fixtures/handler_process/deploy_types_lagoon/.env @@ -1,4 +1,4 @@ -@@ -172,7 +172,7 @@ +@@ -179,7 +179,7 @@ # Deployment occurs when tests pass in the CI environment. # @see https://www.vortextemplate.com/docs/deployment diff --git a/.vortex/installer/tests/Fixtures/handler_process/deploy_types_none_circleci/.env b/.vortex/installer/tests/Fixtures/handler_process/deploy_types_none_circleci/.env index ffcc670f1..c57a27d8e 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/deploy_types_none_circleci/.env +++ b/.vortex/installer/tests/Fixtures/handler_process/deploy_types_none_circleci/.env @@ -1,4 +1,4 @@ -@@ -167,14 +167,6 @@ +@@ -174,14 +174,6 @@ VORTEX_RELEASE_VERSION_SCHEME=calver ################################################################################ diff --git a/.vortex/installer/tests/Fixtures/handler_process/deploy_types_none_gha/.env b/.vortex/installer/tests/Fixtures/handler_process/deploy_types_none_gha/.env index ffcc670f1..c57a27d8e 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/deploy_types_none_gha/.env +++ b/.vortex/installer/tests/Fixtures/handler_process/deploy_types_none_gha/.env @@ -1,4 +1,4 @@ -@@ -167,14 +167,6 @@ +@@ -174,14 +174,6 @@ VORTEX_RELEASE_VERSION_SCHEME=calver ################################################################################ diff --git a/.vortex/installer/tests/Fixtures/handler_process/hosting_acquia/.env b/.vortex/installer/tests/Fixtures/handler_process/hosting_acquia/.env index 07feed129..fd7fd8282 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/hosting_acquia/.env +++ b/.vortex/installer/tests/Fixtures/handler_process/hosting_acquia/.env @@ -7,7 +7,7 @@ # The timezone used within the containers. TZ=UTC -@@ -120,6 +120,13 @@ +@@ -127,6 +127,13 @@ VORTEX_PROVISION_USE_MAINTENANCE_MODE=1 ################################################################################ @@ -21,7 +21,7 @@ # DATABASE SOURCE # ################################################################################ -@@ -142,13 +149,8 @@ +@@ -149,13 +156,8 @@ VORTEX_DB_FILE=db.sql # Database download source. @@ -36,7 +36,7 @@ # Environment to download the database from. # # Applies to hosting environments. -@@ -156,6 +158,9 @@ +@@ -163,6 +165,9 @@ # a branch name or an environment name. VORTEX_DOWNLOAD_DB_ENVIRONMENT=prod @@ -46,7 +46,7 @@ ################################################################################ # RELEASE VERSIONING # ################################################################################ -@@ -172,7 +177,7 @@ +@@ -179,7 +184,7 @@ # Deployment occurs when tests pass in the CI environment. # @see https://www.vortextemplate.com/docs/deployment @@ -55,7 +55,7 @@ ################################################################################ # NOTIFICATIONS # -@@ -189,7 +194,7 @@ +@@ -196,7 +201,7 @@ # An email address to send notifications from. # # Applies to email notifications. @@ -64,7 +64,7 @@ # Email address(es) to send notifications to. # -@@ -199,17 +204,3 @@ +@@ -206,17 +211,3 @@ # with optional names in the format "email|name". # Example: "to1@example.com|Jane Doe, to2@example.com|John Doe" VORTEX_NOTIFY_EMAIL_RECIPIENTS="webmaster@star-wars.com|Webmaster" diff --git a/.vortex/installer/tests/Fixtures/handler_process/hosting_lagoon/.env b/.vortex/installer/tests/Fixtures/handler_process/hosting_lagoon/.env index 2b7b44fa7..4f8bcacd0 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/hosting_lagoon/.env +++ b/.vortex/installer/tests/Fixtures/handler_process/hosting_lagoon/.env @@ -1,4 +1,4 @@ -@@ -120,6 +120,18 @@ +@@ -127,6 +127,18 @@ VORTEX_PROVISION_USE_MAINTENANCE_MODE=1 ################################################################################ @@ -17,7 +17,7 @@ # DATABASE SOURCE # ################################################################################ -@@ -142,13 +154,8 @@ +@@ -149,13 +161,8 @@ VORTEX_DB_FILE=db.sql # Database download source. @@ -32,7 +32,7 @@ # Environment to download the database from. # # Applies to hosting environments. -@@ -172,7 +179,7 @@ +@@ -179,7 +186,7 @@ # Deployment occurs when tests pass in the CI environment. # @see https://www.vortextemplate.com/docs/deployment @@ -41,7 +41,7 @@ ################################################################################ # NOTIFICATIONS # -@@ -199,17 +206,3 @@ +@@ -206,17 +213,3 @@ # with optional names in the format "email|name". # Example: "to1@example.com|Jane Doe, to2@example.com|John Doe" VORTEX_NOTIFY_EMAIL_RECIPIENTS="webmaster@star-wars.com|Webmaster" diff --git a/.vortex/installer/tests/Fixtures/handler_process/hosting_project_name___acquia/.env b/.vortex/installer/tests/Fixtures/handler_process/hosting_project_name___acquia/.env index 90d105ca3..a221c75a6 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/hosting_project_name___acquia/.env +++ b/.vortex/installer/tests/Fixtures/handler_process/hosting_project_name___acquia/.env @@ -7,7 +7,7 @@ # The timezone used within the containers. TZ=UTC -@@ -120,6 +120,13 @@ +@@ -127,6 +127,13 @@ VORTEX_PROVISION_USE_MAINTENANCE_MODE=1 ################################################################################ @@ -21,7 +21,7 @@ # DATABASE SOURCE # ################################################################################ -@@ -142,13 +149,8 @@ +@@ -149,13 +156,8 @@ VORTEX_DB_FILE=db.sql # Database download source. @@ -36,7 +36,7 @@ # Environment to download the database from. # # Applies to hosting environments. -@@ -156,6 +158,9 @@ +@@ -163,6 +165,9 @@ # a branch name or an environment name. VORTEX_DOWNLOAD_DB_ENVIRONMENT=prod @@ -46,7 +46,7 @@ ################################################################################ # RELEASE VERSIONING # ################################################################################ -@@ -172,7 +177,7 @@ +@@ -179,7 +184,7 @@ # Deployment occurs when tests pass in the CI environment. # @see https://www.vortextemplate.com/docs/deployment @@ -55,7 +55,7 @@ ################################################################################ # NOTIFICATIONS # -@@ -189,7 +194,7 @@ +@@ -196,7 +201,7 @@ # An email address to send notifications from. # # Applies to email notifications. @@ -64,7 +64,7 @@ # Email address(es) to send notifications to. # -@@ -199,17 +204,3 @@ +@@ -206,17 +211,3 @@ # with optional names in the format "email|name". # Example: "to1@example.com|Jane Doe, to2@example.com|John Doe" VORTEX_NOTIFY_EMAIL_RECIPIENTS="webmaster@star-wars.com|Webmaster" diff --git a/.vortex/installer/tests/Fixtures/handler_process/hosting_project_name___lagoon/.env b/.vortex/installer/tests/Fixtures/handler_process/hosting_project_name___lagoon/.env index b6b4e539b..144856b1f 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/hosting_project_name___lagoon/.env +++ b/.vortex/installer/tests/Fixtures/handler_process/hosting_project_name___lagoon/.env @@ -1,4 +1,4 @@ -@@ -120,6 +120,18 @@ +@@ -127,6 +127,18 @@ VORTEX_PROVISION_USE_MAINTENANCE_MODE=1 ################################################################################ @@ -17,7 +17,7 @@ # DATABASE SOURCE # ################################################################################ -@@ -142,13 +154,8 @@ +@@ -149,13 +161,8 @@ VORTEX_DB_FILE=db.sql # Database download source. @@ -32,7 +32,7 @@ # Environment to download the database from. # # Applies to hosting environments. -@@ -172,7 +179,7 @@ +@@ -179,7 +186,7 @@ # Deployment occurs when tests pass in the CI environment. # @see https://www.vortextemplate.com/docs/deployment @@ -41,7 +41,7 @@ ################################################################################ # NOTIFICATIONS # -@@ -199,17 +206,3 @@ +@@ -206,17 +213,3 @@ # with optional names in the format "email|name". # Example: "to1@example.com|Jane Doe, to2@example.com|John Doe" VORTEX_NOTIFY_EMAIL_RECIPIENTS="webmaster@star-wars.com|Webmaster" diff --git a/.vortex/installer/tests/Fixtures/handler_process/migration_disabled_lagoon/.env b/.vortex/installer/tests/Fixtures/handler_process/migration_disabled_lagoon/.env index 2b7b44fa7..4f8bcacd0 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/migration_disabled_lagoon/.env +++ b/.vortex/installer/tests/Fixtures/handler_process/migration_disabled_lagoon/.env @@ -1,4 +1,4 @@ -@@ -120,6 +120,18 @@ +@@ -127,6 +127,18 @@ VORTEX_PROVISION_USE_MAINTENANCE_MODE=1 ################################################################################ @@ -17,7 +17,7 @@ # DATABASE SOURCE # ################################################################################ -@@ -142,13 +154,8 @@ +@@ -149,13 +161,8 @@ VORTEX_DB_FILE=db.sql # Database download source. @@ -32,7 +32,7 @@ # Environment to download the database from. # # Applies to hosting environments. -@@ -172,7 +179,7 @@ +@@ -179,7 +186,7 @@ # Deployment occurs when tests pass in the CI environment. # @see https://www.vortextemplate.com/docs/deployment @@ -41,7 +41,7 @@ ################################################################################ # NOTIFICATIONS # -@@ -199,17 +206,3 @@ +@@ -206,17 +213,3 @@ # with optional names in the format "email|name". # Example: "to1@example.com|Jane Doe, to2@example.com|John Doe" VORTEX_NOTIFY_EMAIL_RECIPIENTS="webmaster@star-wars.com|Webmaster" diff --git a/.vortex/installer/tests/Fixtures/handler_process/migration_download_source_acquia/.env b/.vortex/installer/tests/Fixtures/handler_process/migration_download_source_acquia/.env index 14b9372e7..9c189d3c8 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/migration_download_source_acquia/.env +++ b/.vortex/installer/tests/Fixtures/handler_process/migration_download_source_acquia/.env @@ -1,4 +1,4 @@ -@@ -157,6 +157,24 @@ +@@ -164,6 +164,24 @@ VORTEX_DOWNLOAD_DB_ENVIRONMENT=prod ################################################################################ diff --git a/.vortex/installer/tests/Fixtures/handler_process/migration_download_source_ftp/.env b/.vortex/installer/tests/Fixtures/handler_process/migration_download_source_ftp/.env index f4fa651e9..3e24caa25 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/migration_download_source_ftp/.env +++ b/.vortex/installer/tests/Fixtures/handler_process/migration_download_source_ftp/.env @@ -1,4 +1,4 @@ -@@ -157,6 +157,35 @@ +@@ -164,6 +164,35 @@ VORTEX_DOWNLOAD_DB_ENVIRONMENT=prod ################################################################################ diff --git a/.vortex/installer/tests/Fixtures/handler_process/migration_download_source_lagoon/.env b/.vortex/installer/tests/Fixtures/handler_process/migration_download_source_lagoon/.env index e9a5abbb0..2acff57ed 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/migration_download_source_lagoon/.env +++ b/.vortex/installer/tests/Fixtures/handler_process/migration_download_source_lagoon/.env @@ -1,4 +1,4 @@ -@@ -157,6 +157,24 @@ +@@ -164,6 +164,24 @@ VORTEX_DOWNLOAD_DB_ENVIRONMENT=prod ################################################################################ diff --git a/.vortex/installer/tests/Fixtures/handler_process/migration_download_source_s3/.env b/.vortex/installer/tests/Fixtures/handler_process/migration_download_source_s3/.env index b2d3ad0e4..2f83a8e5e 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/migration_download_source_s3/.env +++ b/.vortex/installer/tests/Fixtures/handler_process/migration_download_source_s3/.env @@ -1,4 +1,4 @@ -@@ -157,6 +157,32 @@ +@@ -164,6 +164,32 @@ VORTEX_DOWNLOAD_DB_ENVIRONMENT=prod ################################################################################ diff --git a/.vortex/installer/tests/Fixtures/handler_process/migration_download_source_url/.env b/.vortex/installer/tests/Fixtures/handler_process/migration_download_source_url/.env index d936dac5d..fcfd67a4c 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/migration_download_source_url/.env +++ b/.vortex/installer/tests/Fixtures/handler_process/migration_download_source_url/.env @@ -1,4 +1,4 @@ -@@ -157,6 +157,29 @@ +@@ -164,6 +164,29 @@ VORTEX_DOWNLOAD_DB_ENVIRONMENT=prod ################################################################################ @@ -28,7 +28,7 @@ # RELEASE VERSIONING # ################################################################################ -@@ -213,3 +236,6 @@ +@@ -220,3 +243,6 @@ # URL of the database used for demonstration with URL database download type. VORTEX_DOWNLOAD_DB_URL=https://github.com/drevops/vortex/releases/download/__VERSION__/db_d11.demo.sql diff --git a/.vortex/installer/tests/Fixtures/handler_process/migration_enabled/.env b/.vortex/installer/tests/Fixtures/handler_process/migration_enabled/.env index d936dac5d..fcfd67a4c 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/migration_enabled/.env +++ b/.vortex/installer/tests/Fixtures/handler_process/migration_enabled/.env @@ -1,4 +1,4 @@ -@@ -157,6 +157,29 @@ +@@ -164,6 +164,29 @@ VORTEX_DOWNLOAD_DB_ENVIRONMENT=prod ################################################################################ @@ -28,7 +28,7 @@ # RELEASE VERSIONING # ################################################################################ -@@ -213,3 +236,6 @@ +@@ -220,3 +243,6 @@ # URL of the database used for demonstration with URL database download type. VORTEX_DOWNLOAD_DB_URL=https://github.com/drevops/vortex/releases/download/__VERSION__/db_d11.demo.sql diff --git a/.vortex/installer/tests/Fixtures/handler_process/migration_enabled_circleci/.env b/.vortex/installer/tests/Fixtures/handler_process/migration_enabled_circleci/.env index d936dac5d..fcfd67a4c 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/migration_enabled_circleci/.env +++ b/.vortex/installer/tests/Fixtures/handler_process/migration_enabled_circleci/.env @@ -1,4 +1,4 @@ -@@ -157,6 +157,29 @@ +@@ -164,6 +164,29 @@ VORTEX_DOWNLOAD_DB_ENVIRONMENT=prod ################################################################################ @@ -28,7 +28,7 @@ # RELEASE VERSIONING # ################################################################################ -@@ -213,3 +236,6 @@ +@@ -220,3 +243,6 @@ # URL of the database used for demonstration with URL database download type. VORTEX_DOWNLOAD_DB_URL=https://github.com/drevops/vortex/releases/download/__VERSION__/db_d11.demo.sql diff --git a/.vortex/installer/tests/Fixtures/handler_process/migration_enabled_lagoon/.env b/.vortex/installer/tests/Fixtures/handler_process/migration_enabled_lagoon/.env index e3a5d3504..45cce0b40 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/migration_enabled_lagoon/.env +++ b/.vortex/installer/tests/Fixtures/handler_process/migration_enabled_lagoon/.env @@ -1,4 +1,4 @@ -@@ -120,6 +120,18 @@ +@@ -127,6 +127,18 @@ VORTEX_PROVISION_USE_MAINTENANCE_MODE=1 ################################################################################ @@ -17,7 +17,7 @@ # DATABASE SOURCE # ################################################################################ -@@ -142,13 +154,8 @@ +@@ -149,13 +161,8 @@ VORTEX_DB_FILE=db.sql # Database download source. @@ -32,7 +32,7 @@ # Environment to download the database from. # # Applies to hosting environments. -@@ -157,6 +164,24 @@ +@@ -164,6 +171,24 @@ VORTEX_DOWNLOAD_DB_ENVIRONMENT=prod ################################################################################ @@ -57,7 +57,7 @@ # RELEASE VERSIONING # ################################################################################ -@@ -172,7 +197,7 @@ +@@ -179,7 +204,7 @@ # Deployment occurs when tests pass in the CI environment. # @see https://www.vortextemplate.com/docs/deployment @@ -66,7 +66,7 @@ ################################################################################ # NOTIFICATIONS # -@@ -199,17 +224,3 @@ +@@ -206,17 +231,3 @@ # with optional names in the format "email|name". # Example: "to1@example.com|Jane Doe, to2@example.com|John Doe" VORTEX_NOTIFY_EMAIL_RECIPIENTS="webmaster@star-wars.com|Webmaster" diff --git a/.vortex/installer/tests/Fixtures/handler_process/names/.env b/.vortex/installer/tests/Fixtures/handler_process/names/.env index 396c8dd40..f276b201c 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/names/.env +++ b/.vortex/installer/tests/Fixtures/handler_process/names/.env @@ -31,7 +31,7 @@ # Shield message. DRUPAL_SHIELD_PRINT="Restricted access." -@@ -114,7 +114,7 @@ +@@ -121,7 +121,7 @@ # # Applied if database sanitization is enabled. # @see https://www.vortextemplate.com/docs/drupal/provision#database-sanitization @@ -40,7 +40,7 @@ # Put the site into a maintenance mode during site provisioning. VORTEX_PROVISION_USE_MAINTENANCE_MODE=1 -@@ -189,7 +189,7 @@ +@@ -196,7 +196,7 @@ # An email address to send notifications from. # # Applies to email notifications. @@ -49,7 +49,7 @@ # Email address(es) to send notifications to. # -@@ -198,7 +198,7 @@ +@@ -205,7 +205,7 @@ # Multiple names can be specified as a comma-separated list of email addresses # with optional names in the format "email|name". # Example: "to1@example.com|Jane Doe, to2@example.com|John Doe" diff --git a/.vortex/installer/tests/Fixtures/handler_process/notification_channels_all/.env b/.vortex/installer/tests/Fixtures/handler_process/notification_channels_all/.env index cf5b18664..7f34e2569 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/notification_channels_all/.env +++ b/.vortex/installer/tests/Fixtures/handler_process/notification_channels_all/.env @@ -1,4 +1,4 @@ -@@ -184,7 +184,7 @@ +@@ -191,7 +191,7 @@ # The channels of the notifications. # # A combination of comma-separated values: email,slack,newrelic,github,jira,webhook @@ -7,7 +7,7 @@ # An email address to send notifications from. # -@@ -199,6 +199,12 @@ +@@ -206,6 +206,12 @@ # with optional names in the format "email|name". # Example: "to1@example.com|Jane Doe, to2@example.com|John Doe" VORTEX_NOTIFY_EMAIL_RECIPIENTS="webmaster@star-wars.com|Webmaster" diff --git a/.vortex/installer/tests/Fixtures/handler_process/notification_channels_github_only/.env b/.vortex/installer/tests/Fixtures/handler_process/notification_channels_github_only/.env index 2bce28bcd..9d4ef259d 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/notification_channels_github_only/.env +++ b/.vortex/installer/tests/Fixtures/handler_process/notification_channels_github_only/.env @@ -1,4 +1,4 @@ -@@ -184,21 +184,7 @@ +@@ -191,21 +191,7 @@ # The channels of the notifications. # # A combination of comma-separated values: email,slack,newrelic,github,jira,webhook diff --git a/.vortex/installer/tests/Fixtures/handler_process/notification_channels_jira_only/.env b/.vortex/installer/tests/Fixtures/handler_process/notification_channels_jira_only/.env index ba0900d7a..3624ce05b 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/notification_channels_jira_only/.env +++ b/.vortex/installer/tests/Fixtures/handler_process/notification_channels_jira_only/.env @@ -1,4 +1,4 @@ -@@ -184,21 +184,10 @@ +@@ -191,21 +191,10 @@ # The channels of the notifications. # # A combination of comma-separated values: email,slack,newrelic,github,jira,webhook diff --git a/.vortex/installer/tests/Fixtures/handler_process/notification_channels_newrelic_only/.env b/.vortex/installer/tests/Fixtures/handler_process/notification_channels_newrelic_only/.env index fee1af85e..833a36aaa 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/notification_channels_newrelic_only/.env +++ b/.vortex/installer/tests/Fixtures/handler_process/notification_channels_newrelic_only/.env @@ -1,4 +1,4 @@ -@@ -184,21 +184,7 @@ +@@ -191,21 +191,7 @@ # The channels of the notifications. # # A combination of comma-separated values: email,slack,newrelic,github,jira,webhook diff --git a/.vortex/installer/tests/Fixtures/handler_process/notification_channels_none/.env b/.vortex/installer/tests/Fixtures/handler_process/notification_channels_none/.env index ccbd6b449..84069b25e 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/notification_channels_none/.env +++ b/.vortex/installer/tests/Fixtures/handler_process/notification_channels_none/.env @@ -1,4 +1,4 @@ -@@ -184,21 +184,7 @@ +@@ -191,21 +191,7 @@ # The channels of the notifications. # # A combination of comma-separated values: email,slack,newrelic,github,jira,webhook diff --git a/.vortex/installer/tests/Fixtures/handler_process/notification_channels_slack_only/.env b/.vortex/installer/tests/Fixtures/handler_process/notification_channels_slack_only/.env index e5a60c062..5694ed384 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/notification_channels_slack_only/.env +++ b/.vortex/installer/tests/Fixtures/handler_process/notification_channels_slack_only/.env @@ -1,4 +1,4 @@ -@@ -184,21 +184,7 @@ +@@ -191,21 +191,7 @@ # The channels of the notifications. # # A combination of comma-separated values: email,slack,newrelic,github,jira,webhook diff --git a/.vortex/installer/tests/Fixtures/handler_process/notification_channels_webhook_only/.env b/.vortex/installer/tests/Fixtures/handler_process/notification_channels_webhook_only/.env index 9b3303dfc..57818aae7 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/notification_channels_webhook_only/.env +++ b/.vortex/installer/tests/Fixtures/handler_process/notification_channels_webhook_only/.env @@ -1,4 +1,4 @@ -@@ -184,21 +184,10 @@ +@@ -191,21 +191,10 @@ # The channels of the notifications. # # A combination of comma-separated values: email,slack,newrelic,github,jira,webhook diff --git a/.vortex/installer/tests/Fixtures/handler_process/provision_database_lagoon/.env b/.vortex/installer/tests/Fixtures/handler_process/provision_database_lagoon/.env index 2b7b44fa7..4f8bcacd0 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/provision_database_lagoon/.env +++ b/.vortex/installer/tests/Fixtures/handler_process/provision_database_lagoon/.env @@ -1,4 +1,4 @@ -@@ -120,6 +120,18 @@ +@@ -127,6 +127,18 @@ VORTEX_PROVISION_USE_MAINTENANCE_MODE=1 ################################################################################ @@ -17,7 +17,7 @@ # DATABASE SOURCE # ################################################################################ -@@ -142,13 +154,8 @@ +@@ -149,13 +161,8 @@ VORTEX_DB_FILE=db.sql # Database download source. @@ -32,7 +32,7 @@ # Environment to download the database from. # # Applies to hosting environments. -@@ -172,7 +179,7 @@ +@@ -179,7 +186,7 @@ # Deployment occurs when tests pass in the CI environment. # @see https://www.vortextemplate.com/docs/deployment @@ -41,7 +41,7 @@ ################################################################################ # NOTIFICATIONS # -@@ -199,17 +206,3 @@ +@@ -206,17 +213,3 @@ # with optional names in the format "email|name". # Example: "to1@example.com|Jane Doe, to2@example.com|John Doe" VORTEX_NOTIFY_EMAIL_RECIPIENTS="webmaster@star-wars.com|Webmaster" diff --git a/.vortex/installer/tests/Fixtures/handler_process/provision_profile/.env b/.vortex/installer/tests/Fixtures/handler_process/provision_profile/.env index 907478499..c41be8a9e 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/provision_profile/.env +++ b/.vortex/installer/tests/Fixtures/handler_process/provision_profile/.env @@ -7,7 +7,7 @@ # Overwrite a database if it exists. # -@@ -141,21 +141,6 @@ +@@ -148,21 +148,6 @@ # The file is used to import the database into an empty database container. VORTEX_DB_FILE=db.sql @@ -29,7 +29,7 @@ ################################################################################ # RELEASE VERSIONING # ################################################################################ -@@ -199,17 +184,3 @@ +@@ -206,17 +191,3 @@ # with optional names in the format "email|name". # Example: "to1@example.com|Jane Doe, to2@example.com|John Doe" VORTEX_NOTIFY_EMAIL_RECIPIENTS="webmaster@star-wars.com|Webmaster" diff --git a/.vortex/installer/tests/Fixtures/handler_process/starter_drupal_cms_profile/.env b/.vortex/installer/tests/Fixtures/handler_process/starter_drupal_cms_profile/.env index 02d773c16..723b99553 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/starter_drupal_cms_profile/.env +++ b/.vortex/installer/tests/Fixtures/handler_process/starter_drupal_cms_profile/.env @@ -7,7 +7,7 @@ # Drupal configuration directory. # -@@ -199,17 +199,3 @@ +@@ -206,17 +206,3 @@ # with optional names in the format "email|name". # Example: "to1@example.com|Jane Doe, to2@example.com|John Doe" VORTEX_NOTIFY_EMAIL_RECIPIENTS="webmaster@star-wars.com|Webmaster" diff --git a/.vortex/installer/tests/Fixtures/handler_process/starter_drupal_profile/.env b/.vortex/installer/tests/Fixtures/handler_process/starter_drupal_profile/.env index 2174c7d07..af7e88b1e 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/starter_drupal_profile/.env +++ b/.vortex/installer/tests/Fixtures/handler_process/starter_drupal_profile/.env @@ -1,4 +1,4 @@ -@@ -199,17 +199,3 @@ +@@ -206,17 +206,3 @@ # with optional names in the format "email|name". # Example: "to1@example.com|Jane Doe, to2@example.com|John Doe" VORTEX_NOTIFY_EMAIL_RECIPIENTS="webmaster@star-wars.com|Webmaster" diff --git a/.vortex/installer/tests/Fixtures/handler_process/version_scheme_other/.env b/.vortex/installer/tests/Fixtures/handler_process/version_scheme_other/.env index 24e56d775..54be5fac9 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/version_scheme_other/.env +++ b/.vortex/installer/tests/Fixtures/handler_process/version_scheme_other/.env @@ -1,4 +1,4 @@ -@@ -164,7 +164,7 @@ +@@ -171,7 +171,7 @@ # # Can be one of: calver, semver, other # @see https://www.vortextemplate.com/docs/releasing diff --git a/.vortex/installer/tests/Fixtures/handler_process/version_scheme_semver/.env b/.vortex/installer/tests/Fixtures/handler_process/version_scheme_semver/.env index 720675cc7..8079f5eae 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/version_scheme_semver/.env +++ b/.vortex/installer/tests/Fixtures/handler_process/version_scheme_semver/.env @@ -1,4 +1,4 @@ -@@ -164,7 +164,7 @@ +@@ -171,7 +171,7 @@ # # Can be one of: calver, semver, other # @see https://www.vortextemplate.com/docs/releasing diff --git a/.vortex/tests/bats/unit/provision.bats b/.vortex/tests/bats/unit/provision.bats index 81f51c1da..b4de4c5c5 100644 --- a/.vortex/tests/bats/unit/provision.bats +++ b/.vortex/tests/bats/unit/provision.bats @@ -40,6 +40,7 @@ assert_provision_info() { assert_output_contains "Existing site found : $(format_yes_no "${7:-0}")" assert_output_contains "Provision type : ${provision_type}" + assert_output_contains "Fallback to profile : $(format_yes_no "${9:-0}")" assert_output_contains "Overwrite existing DB : $(format_yes_no "${2:-0}")" assert_output_contains "Skip DB sanitization : $(format_yes_no "${3:-0}")" assert_output_contains "Skip post-provision operations : $(format_yes_no "${5:-0}")" @@ -1446,3 +1447,177 @@ assert_provision_info() { popd >/dev/null || exit 1 } + +@test "Provision: DB; no site; fallback to profile" { + pushd "${LOCAL_REPO_DIR}" >/dev/null || exit 1 + + # Remove .env file to test in isolation. + rm ./.env && touch ./.env + rm -f ./scripts/custom/provision-20-migration.sh + + export VORTEX_PROVISION_SANITIZE_DB_PASSWORD="MOCK_DB_SANITIZE_PASSWORD" + export CI=1 + + # Create the data directory but do NOT create the dump file. + mkdir "./.data" + + export VORTEX_PROVISION_FALLBACK_TO_PROFILE=1 + export VORTEX_PROVISION_POST_OPERATIONS_SKIP=1 + + create_global_command_wrapper "vendor/bin/drush" + + declare -a STEPS=( + # Drush status calls. + "@drush -y --version # Drush Commandline Tool mocked_drush_version" + "@drush -y status --field=drupal-version # mocked_core_version" + "@drush -y status --fields=bootstrap # fail" + "@drush -y php:eval print realpath(\Drupal\Core\Site\Settings::get(\"config_sync_directory\")); # $(pwd)/config/default" + + # Site provisioning information. + "Provisioning site from the database dump file." + "Dump file path: $(pwd)/.data/db.sql" + "Existing site was not found." + "Fresh site content will be imported from the database dump file." + + # Fallback to profile. + "Database dump file is not available. Falling back to profile installation." + "@drush -y sql:drop" + "@drush -y site:install standard --site-name=Example site --site-mail=webmaster@example.com --account-name=admin install_configure_form.enable_update_status_module=NULL install_configure_form.enable_update_status_emails=NULL" + "Installed a site from the profile." + + # Should NOT see the hard failure messages. + "- Unable to import database from file." + "- Dump file $(pwd)/.data/db.sql does not exist." + "- Site content was not changed." + + # Drupal environment information. + "Current Drupal environment: ci" + "@drush -y php:eval print \Drupal\core\Site\Settings::get('environment'); # ci" + + # Post-provision operations skipped. + "Skipped running of post-provision operations as VORTEX_PROVISION_POST_OPERATIONS_SKIP is set to 1." + + # Installation completion. + "Finished site provisioning" + ) + + mocks="$(run_steps "setup")" + + run ./scripts/vortex/provision.sh + assert_success + + run_steps "assert" "${mocks[@]}" + + popd >/dev/null || exit 1 +} + +@test "Provision: DB; no site; with container image; fallback to profile" { + pushd "${LOCAL_REPO_DIR}" >/dev/null || exit 1 + + # Remove .env file to test in isolation. + rm ./.env && touch ./.env + rm -f ./scripts/custom/provision-20-migration.sh + + export CI=1 + export VORTEX_DB_IMAGE="drevops/vortex-dev-mariadb-drupal-data-test-11.x:latest" + + mkdir "./.data" + touch "./.data/db.sql" + + export VORTEX_PROVISION_FALLBACK_TO_PROFILE=1 + export VORTEX_PROVISION_POST_OPERATIONS_SKIP=1 + + create_global_command_wrapper "vendor/bin/drush" + + declare -a STEPS=( + # Drush status calls. + "@drush -y --version # Drush Commandline Tool mocked_drush_version" + "@drush -y status --field=drupal-version # mocked_core_version" + "@drush -y status --fields=bootstrap # fail" + "@drush -y php:eval print realpath(\Drupal\Core\Site\Settings::get(\"config_sync_directory\")); # $(pwd)/config/default" + + # Site provisioning information with container image. + "DB dump container image : ${VORTEX_DB_IMAGE}" + "Provisioning site from the database dump file." + "Dump file path: $(pwd)/.data/db.sql" + "Existing site was not found." + "Database is baked into the container image." + + # Fallback to profile instead of corrupted error. + "Database in the container image is not available. Falling back to profile installation." + "@drush -y sql:drop" + "@drush -y site:install standard --site-name=Example site --site-mail=webmaster@example.com --account-name=admin install_configure_form.enable_update_status_module=NULL install_configure_form.enable_update_status_emails=NULL" + "Installed a site from the profile." + + # Should NOT see the corrupted error messages or file-based provisioning. + "- Looks like the database in the container image is corrupted." + "- Site content was not changed." + "- Fresh site content will be imported from the database dump file." + + # Drupal environment information. + "Current Drupal environment: ci" + "@drush -y php:eval print \Drupal\core\Site\Settings::get('environment'); # ci" + + # Post-provision operations skipped. + "Skipped running of post-provision operations as VORTEX_PROVISION_POST_OPERATIONS_SKIP is set to 1." + + # Installation completion. + "Finished site provisioning" + ) + + mocks="$(run_steps "setup")" + + run ./scripts/vortex/provision.sh + assert_success + + run_steps "assert" "${mocks[@]}" + + popd >/dev/null || exit 1 +} + +@test "Provision: DB; no site; no fallback" { + pushd "${LOCAL_REPO_DIR}" >/dev/null || exit 1 + + # Remove .env file to test in isolation. + rm ./.env && touch ./.env + rm -f ./scripts/custom/provision-20-migration.sh + + export CI=1 + + # Create the data directory but do NOT create the dump file. + mkdir "./.data" + + create_global_command_wrapper "vendor/bin/drush" + + declare -a STEPS=( + # Drush status calls. + "@drush -y --version # Drush Commandline Tool mocked_drush_version" + "@drush -y status --field=drupal-version # mocked_core_version" + "@drush -y status --fields=bootstrap # fail" + "@drush -y php:eval print realpath(\Drupal\Core\Site\Settings::get(\"config_sync_directory\")); # $(pwd)/config/default" + + # Site provisioning information. + "Provisioning site from the database dump file." + "Dump file path: $(pwd)/.data/db.sql" + "Existing site was not found." + "Fresh site content will be imported from the database dump file." + + # Hard failure - no fallback. + "Unable to import database from file." + "Dump file $(pwd)/.data/db.sql does not exist." + "Site content was not changed." + + # Should NOT see fallback messages. + "- Database dump file is not available. Falling back to profile installation." + "- Installed a site from the profile." + ) + + mocks="$(run_steps "setup")" + + run ./scripts/vortex/provision.sh + assert_failure + + run_steps "assert" "${mocks[@]}" + + popd >/dev/null || exit 1 +} diff --git a/scripts/vortex/provision.sh b/scripts/vortex/provision.sh index a5cc3f437..30f9bc223 100755 --- a/scripts/vortex/provision.sh +++ b/scripts/vortex/provision.sh @@ -19,6 +19,9 @@ VORTEX_PROVISION_SKIP="${VORTEX_PROVISION_SKIP:-}" # Provision type: database or profile. VORTEX_PROVISION_TYPE="${VORTEX_PROVISION_TYPE:-database}" +# Fallback to profile installation if the database dump is not available. +VORTEX_PROVISION_FALLBACK_TO_PROFILE="${VORTEX_PROVISION_FALLBACK_TO_PROFILE:-0}" + # Flag to always overwrite existing database. Usually set to 0 in deployed # environments. VORTEX_PROVISION_OVERRIDE_DB="${VORTEX_PROVISION_OVERRIDE_DB:-0}" @@ -131,6 +134,7 @@ note "Configuration files present : $(yesno "${site_has_config_files}")" note "Existing site found : $(yesno "${site_is_installed}")" echo note "Provision type : ${VORTEX_PROVISION_TYPE}" +note "Fallback to profile : $(yesno "${VORTEX_PROVISION_FALLBACK_TO_PROFILE}")" note "Overwrite existing DB : $(yesno "${VORTEX_PROVISION_OVERRIDE_DB}")" note "Skip DB sanitization : $(yesno "${VORTEX_PROVISION_SANITIZE_DB_SKIP}")" note "Skip post-provision operations : $(yesno "${VORTEX_PROVISION_POST_OPERATIONS_SKIP}")" @@ -143,10 +147,17 @@ echo # provision_from_db() { if [ ! -f "${VORTEX_PROVISION_DB}" ]; then + if [ "${VORTEX_PROVISION_FALLBACK_TO_PROFILE}" = "1" ]; then + info "Database dump file is not available. Falling back to profile installation." + provision_from_profile + return + fi + echo fail "Unable to import database from file." note "Dump file ${VORTEX_PROVISION_DB} does not exist." note "Site content was not changed." + exit 1 fi @@ -215,15 +226,21 @@ if [ "${VORTEX_PROVISION_TYPE}" = "database" ]; then if [ -n "${VORTEX_PROVISION_DB_IMAGE-}" ]; then note "Database is baked into the container image." - note "Looks like the database in the container image is corrupted." - note "Site content was not changed." - exit 1 + if [ "${VORTEX_PROVISION_FALLBACK_TO_PROFILE}" = "1" ]; then + info "Database in the container image is not available. Falling back to profile installation." + provision_from_profile + export VORTEX_PROVISION_OVERRIDE_DB=1 + else + note "Looks like the database in the container image is corrupted." + note "Site content was not changed." + exit 1 + fi + else + note "Fresh site content will be imported from the database dump file." + provision_from_db + # Let the downstream scripts know that the database is fresh. + export VORTEX_PROVISION_OVERRIDE_DB=1 fi - - note "Fresh site content will be imported from the database dump file." - provision_from_db - # Let the downstream scripts know that the database is fresh. - export VORTEX_PROVISION_OVERRIDE_DB=1 fi else info "Provisioning site from the profile."