Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .env
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,7 @@ VORTEX_NOTIFY_WEBHOOK_URL=

#;< DB_DOWNLOAD_SOURCE_URL
# URL of the database used for demonstration with URL database download type.
VORTEX_DOWNLOAD_DB_URL=https://github.com/drevops/vortex/releases/download/25.4.0/db_d11.demo.sql
VORTEX_DOWNLOAD_DB_URL=https://github.com/drevops/vortex/releases/download/1.37.0/db.demo.sql
#;> DB_DOWNLOAD_SOURCE_URL

#;< MIGRATION
Expand All @@ -390,6 +390,6 @@ VORTEX_DOWNLOAD_DB2_URL=https://github.com/drevops/vortex/releases/download/25.4
# The line below will be automatically uncommented for database-in-image
# storage. It is commented out to allow running non-database-in-image
# workflow by default.
##### VORTEX_DB_IMAGE=drevops/vortex-dev-mariadb-drupal-data-demo-11.x:latest
##### VORTEX_DB_IMAGE=drevops/vortex-dev-mariadb-drupal-data-demo-11.x:1.38.0-rc1
#;> DB_DOWNLOAD_SOURCE_CONTAINER_REGISTRY
#;> DEMO_MODE
1 change: 1 addition & 0 deletions .github/workflows/build-test-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -488,6 +488,7 @@ jobs:
- name: Upload coverage report to Codecov
uses: codecov/codecov-action@57e3a136b779b570ffcdbf80b3bdc90e7fab3de2 # v6
if: ${{ (matrix.instance == 0 || strategy.job-total == 1) && env.CODECOV_TOKEN != '' }}
continue-on-error: true
with:
directory: .logs/coverage
fail_ci_if_error: true
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/vortex-test-common.yml
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ jobs:

- name: Upload coverage report to Codecov
uses: codecov/codecov-action@57e3a136b779b570ffcdbf80b3bdc90e7fab3de2 # v6
continue-on-error: true
with:
directory: /tmp/.vortex-coverage-html
fail_ci_if_error: false
Expand Down Expand Up @@ -216,6 +217,7 @@ jobs:

- name: Upload coverage report to Codecov
uses: codecov/codecov-action@57e3a136b779b570ffcdbf80b3bdc90e7fab3de2 # v6
continue-on-error: true
with:
directory: /tmp/.vortex-coverage-html
fail_ci_if_error: false
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/vortex-test-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ jobs:

- name: Upload coverage report to Codecov
uses: codecov/codecov-action@57e3a136b779b570ffcdbf80b3bdc90e7fab3de2 # v6
continue-on-error: true
with:
files: .vortex/docs/.logs/cobertura.xml
fail_ci_if_error: true
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/vortex-test-installer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ jobs:

- name: Upload coverage report to Codecov
uses: codecov/codecov-action@57e3a136b779b570ffcdbf80b3bdc90e7fab3de2 # v6
continue-on-error: true
with:
files: .vortex/installer/.logs/cobertura.xml
fail_ci_if_error: true
Expand Down
202 changes: 36 additions & 166 deletions .vortex/docs/content/contributing/maintenance/template.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -234,188 +234,58 @@ bats .vortex/tests/bats/deploy.bats

## Updating test assets

There are *demo* and *test* database dumps captured as *files* and *container images*.
There are *demo* and *test* database dumps captured as *files* and *container
images*. All flows are automated by `.vortex/tests/update-test-assets`, which
prints every shell command it runs.

### Updating *demo* database dump *file*

<details>
<summary>Show instructions</summary>

1. Run fresh build of **Vortex** locally:
```shell
rm .data/db.sql || true
VORTEX_PROVISION_TYPE=profile VORTEX_PROVISION_POST_OPERATIONS_SKIP=1 AHOY_CONFIRM_RESPONSE=1 ahoy build
```
2. Update content and config:
```shell
ahoy cli

drush eval "Drupal::entityTypeManager()->getStorage('node')->create([
'type' => 'page',
'title' => 'Welcome to the demo site!',
'body' => [
'value' => '<p>This demo page is sourced from the Vortex database dump file to demonstrate database importing capabilities.</p>',
'format' => 'basic_html',
],
])->save();"

drush config:set system.site page.front "/node/1" -y
drush sql:query "SHOW TABLES LIKE 'cache_%'" | xargs -I{} drush sql:query "TRUNCATE TABLE {}" && drush sql:query "TRUNCATE TABLE watchdog"

exit

```
3. Export DB:
```shell
ahoy export-db db.demo.sql
```
4. Upload `db.demo.sql` to the latest release as an asset and name it `db_d11.demo.sql`.

</details>

### Updating *demo* database *container image*

<details>
<summary>Show instructions</summary>

1. Run fresh build of **Vortex** locally:
```shell
rm .data/db.sql || true
VORTEX_PROVISION_TYPE=profile VORTEX_PROVISION_POST_OPERATIONS_SKIP=1 AHOY_CONFIRM_RESPONSE=1 ahoy build
php .vortex/tests/update-test-assets [mode] [--tag <tag>]
```
2. Update content and config:
```shell
ahoy cli

drush eval "Drupal::entityTypeManager()->getStorage('node')->create([
'type' => 'page',
'title' => 'Welcome to the demo site!',
'body' => [
'value' => '<p>This demo page is sourced from the Vortex database container image to demonstrate database importing capabilities.</p>',
'format' => 'basic_html',
],
])->save();"
Without arguments, runs `all` for a full refresh. Default tag is `latest`.

drush config:set system.site page.front "/node/1" -y
drush sql:query "SHOW TABLES LIKE 'cache_%'" | xargs -I{} drush sql:query "TRUNCATE TABLE {}" && drush sql:query "TRUNCATE TABLE watchdog"
### Modes

exit
| Mode | What it does | Follow-up |
| --- | --- | --- |
| `demo-dump` | Builds the demo profile in-place; exports `.data/db.demo.sql`. | Upload as `db.demo.sql` to the latest GitHub release. |
| `demo-image` | Builds the demo profile in-place; pushes `drevops/vortex-dev-mariadb-drupal-data-demo-11.x:<tag>`. | None. |
| `test-dump` | Installs Vortex into `/tmp/star-wars`; builds; exports `/tmp/star-wars/.data/db.test.sql`. | Upload as `db_d11.test.sql` to the latest GitHub release. |
| `test-image` | Installs Vortex into `/tmp/star-wars`; builds; pushes `drevops/vortex-dev-mariadb-drupal-data-test-11.x:<tag>`. | None. |
| `destination-images` | Tags and pushes the local demo image to the didi destination tags (`vortex-dev-database-ii`, `vortex-dev-didi-database-fi`). | None. |
| `all` | Optimised full refresh: builds the demo stack once for both demo modes and the test stack once for both test modes (2 stack builds instead of 4), then pushes images and tags destination images. Default when no mode is given. | Upload both dump files as above. |

```
3. Export DB:
```shell
ahoy export-db db.demo_image.sql
### Options

# Update the collation to avoid issues with MariaDB 10.5+:
sed -i '' 's/utf8mb4_0900_ai_ci/utf8mb4_general_ci/g' .data/db.demo_image.sql
```
4. Seed the database container image:
```shell
curl -LO https://github.com/drevops/mariadb-drupal-data/releases/latest/download/seed.sh
chmod +x seed.sh
./seed.sh .data/db.demo_image.sql drevops/vortex-dev-mariadb-drupal-data-demo-11.x:latest
```

</details>

### Updating *test* database dump *file*

<details>
<summary>Show instructions</summary>
| Option | Description |
| --- | --- |
| `--tag <tag>` | Image tag for image modes. Default: `latest`. Also accepts `--tag=<tag>`. |

1. Run a fresh install of **Vortex** into a new directory and name the project `Star Wars`:
```shell
mkdir /tmp/star-wars
VORTEX_INSTALLER_TEMPLATE_REPO="$(pwd)" .vortex/installer/installer.php /tmp/star-wars --no-interaction
cd /tmp/star-wars
```
2. Run fresh build of **Vortex** locally:
```shell
rm .data/db.sql || true
VORTEX_PROVISION_TYPE=profile AHOY_CONFIRM_RESPONSE=1 ahoy build
```
3. Update content and config:
```shell
ahoy cli

drush eval "Drupal::entityTypeManager()->getStorage('node')->create([
'type' => 'page',
'title' => 'Welcome to the test site!',
'body' => [
'value' => '<p>This test page is sourced from the Vortex database dump file to demonstrate database importing capabilities.</p>',
'format' => 'basic_html',
],
])->save();"

drush config:set system.site page.front "/node/1" -y
drush sql:query "SHOW TABLES LIKE 'cache_%'" | xargs -I{} drush sql:query "TRUNCATE TABLE {}" && drush sql:query "TRUNCATE TABLE watchdog"

exit
### Requirements

```
4. Export DB:
```shell
ahoy export-db db.test.sql
```
5. Upload `db.test.sql` to the latest release as an asset and name it `db_d11.test.sql`.
- `docker`, `ahoy`, `curl`, `sed`, `php` available on `PATH`.
- A Docker Hub session with push permission to `drevops/` for any image mode.

</details>
### Caveats

### Updating *test* database *container image*
- Demo modes are **destructive** against the current repository: containers
are reset and `.data/db.sql` is removed before the rebuild.
- Test modes wipe and recreate `/tmp/star-wars` on each run.
- `destination-images` expects `drevops/vortex-dev-mariadb-drupal-data-demo-11.x:1.38.0-rc1`
to already exist locally - run `demo-image` (or `all`) first.
Comment thread
coderabbitai[bot] marked this conversation as resolved.

<details>
<summary>Show instructions</summary>
### Examples

1. Run a fresh install of **Vortex** into a new directory and name the project `Star Wars`:
```shell
mkdir /tmp/star-wars
VORTEX_INSTALLER_TEMPLATE_REPO="$(pwd)" .vortex/installer/installer.php /tmp/star-wars --no-interaction
cd /tmp/star-wars
```
2. Run fresh build of **Vortex** locally:
```shell
rm .data/db.sql || true
VORTEX_PROVISION_TYPE=profile AHOY_CONFIRM_RESPONSE=1 ahoy build
```
3. Update content and config:
```shell
ahoy cli

drush eval "Drupal::entityTypeManager()->getStorage('node')->create([
'type' => 'page',
'title' => 'Welcome to the test site!',
'body' => [
'value' => '<p>This test page is sourced from the Vortex database container image to demonstrate database importing capabilities.</p>',
'format' => 'basic_html',
],
])->save();"
# Full refresh of every asset at :latest (default).
php .vortex/tests/update-test-assets

drush config:set system.site page.front "/node/1" -y
drush sql:query "SHOW TABLES LIKE 'cache_%'" | xargs -I{} drush sql:query "TRUNCATE TABLE {}" && drush sql:query "TRUNCATE TABLE watchdog"

exit

```
4. Export DB:
```shell
ahoy export-db db.test_image.sql
# Full refresh, tagging images as :rc1.
php .vortex/tests/update-test-assets --tag rc1

# Update the collation to avoid issues with MariaDB 10.5+:
sed -i '' 's/utf8mb4_0900_ai_ci/utf8mb4_general_ci/g' .data/db.test_image.sql
```
5. Seed the database container image:
```shell
curl -LO https://github.com/drevops/mariadb-drupal-data/releases/latest/download/seed.sh
chmod +x seed.sh
./seed.sh .data/db.test_image.sql drevops/vortex-dev-mariadb-drupal-data-test-11.x:latest
```
6. Update destination container images:
```shell
docker tag drevops/vortex-dev-mariadb-drupal-data-demo-11.x:latest drevops/vortex-dev-mariadb-drupal-data-demo-destination-11.x:vortex-dev-database-ii
docker push drevops/vortex-dev-mariadb-drupal-data-demo-destination-11.x:vortex-dev-database-ii
# Refresh only the test container image at :latest.
php .vortex/tests/update-test-assets test-image

docker tag drevops/vortex-dev-mariadb-drupal-data-demo-11.x:latest drevops/vortex-dev-mariadb-drupal-data-demo-destination-11.x:vortex-dev-didi-database-fi
docker push drevops/vortex-dev-mariadb-drupal-data-demo-destination-11.x:vortex-dev-didi-database-fi
# Refresh only the test container image at :rc1.
php .vortex/tests/update-test-assets test-image --tag rc1
```

</details>
Original file line number Diff line number Diff line change
Expand Up @@ -225,4 +225,4 @@ VORTEX_NOTIFY_EMAIL_RECIPIENTS="webmaster@star-wars.com|Webmaster"
################################################################################

# 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
VORTEX_DOWNLOAD_DB_URL=https://github.com/drevops/vortex/releases/download/__VERSION__/db.demo.sql
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
@@ -432,6 +432,16 @@
@@ -432,6 +432,17 @@
</details>
hide_and_recreate: true

+ - name: Upload coverage report to Codecov
+ uses: codecov/codecov-action@__HASH__ # __VERSION__
+ if: ${{ (matrix.instance == 0 || strategy.job-total == 1) && env.CODECOV_TOKEN != '' }}
+ continue-on-error: true
+ with:
+ directory: .logs/coverage
+ fail_ci_if_error: true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,4 @@
-################################################################################
-
-# 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
-VORTEX_DOWNLOAD_DB_URL=https://github.com/drevops/vortex/releases/download/__VERSION__/db.demo.sql
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,4 @@
-################################################################################
-
-# 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
-VORTEX_DOWNLOAD_DB_URL=https://github.com/drevops/vortex/releases/download/__VERSION__/db.demo.sql
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,4 @@
-################################################################################
-
-# 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
-VORTEX_DOWNLOAD_DB_URL=https://github.com/drevops/vortex/releases/download/__VERSION__/db.demo.sql
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,4 @@
-################################################################################
-
-# 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
-VORTEX_DOWNLOAD_DB_URL=https://github.com/drevops/vortex/releases/download/__VERSION__/db.demo.sql
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,4 @@
-################################################################################
-
-# 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
-VORTEX_DOWNLOAD_DB_URL=https://github.com/drevops/vortex/releases/download/__VERSION__/db.demo.sql
Original file line number Diff line number Diff line change
Expand Up @@ -72,4 +72,4 @@
-################################################################################
-
-# 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
-VORTEX_DOWNLOAD_DB_URL=https://github.com/drevops/vortex/releases/download/__VERSION__/db.demo.sql
Original file line number Diff line number Diff line change
Expand Up @@ -58,4 +58,4 @@
-################################################################################
-
-# 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
-VORTEX_DOWNLOAD_DB_URL=https://github.com/drevops/vortex/releases/download/__VERSION__/db.demo.sql
Original file line number Diff line number Diff line change
Expand Up @@ -72,4 +72,4 @@
-################################################################################
-
-# 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
-VORTEX_DOWNLOAD_DB_URL=https://github.com/drevops/vortex/releases/download/__VERSION__/db.demo.sql
Original file line number Diff line number Diff line change
Expand Up @@ -58,4 +58,4 @@
-################################################################################
-
-# 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
-VORTEX_DOWNLOAD_DB_URL=https://github.com/drevops/vortex/releases/download/__VERSION__/db.demo.sql
Original file line number Diff line number Diff line change
Expand Up @@ -58,4 +58,4 @@
-################################################################################
-
-# 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
-VORTEX_DOWNLOAD_DB_URL=https://github.com/drevops/vortex/releases/download/__VERSION__/db.demo.sql
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
@@ -226,3 +249,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
VORTEX_DOWNLOAD_DB_URL=https://github.com/drevops/vortex/releases/download/__VERSION__/db.demo.sql
+
+# URL of the migration source database used for demonstration.
+VORTEX_DOWNLOAD_DB2_URL=https://github.com/drevops/vortex/releases/download/__VERSION__/db_d11.demo_source.sql
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
@@ -226,3 +249,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
VORTEX_DOWNLOAD_DB_URL=https://github.com/drevops/vortex/releases/download/__VERSION__/db.demo.sql
+
+# URL of the migration source database used for demonstration.
+VORTEX_DOWNLOAD_DB2_URL=https://github.com/drevops/vortex/releases/download/__VERSION__/db_d11.demo_source.sql
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
@@ -226,3 +249,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
VORTEX_DOWNLOAD_DB_URL=https://github.com/drevops/vortex/releases/download/__VERSION__/db.demo.sql
+
+# URL of the migration source database used for demonstration.
+VORTEX_DOWNLOAD_DB2_URL=https://github.com/drevops/vortex/releases/download/__VERSION__/db_d11.demo_source.sql
Original file line number Diff line number Diff line change
Expand Up @@ -83,4 +83,4 @@
-################################################################################
-
-# 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
-VORTEX_DOWNLOAD_DB_URL=https://github.com/drevops/vortex/releases/download/__VERSION__/db.demo.sql
Original file line number Diff line number Diff line change
Expand Up @@ -58,4 +58,4 @@
-################################################################################
-
-# 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
-VORTEX_DOWNLOAD_DB_URL=https://github.com/drevops/vortex/releases/download/__VERSION__/db.demo.sql
Loading
Loading