Skip to content

Commit

Permalink
[#1436] Renamed mariadb to database service.
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexSkrypnyk committed Dec 11, 2024
1 parent b94cc08 commit a55a133
Show file tree
Hide file tree
Showing 21 changed files with 211 additions and 211 deletions.
10 changes: 5 additions & 5 deletions .ahoy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ commands:
usage: Show information about this project.
cmd: |
COMPOSE_PROJECT_NAME=${COMPOSE_PROJECT_NAME:-${PWD##*/}} \
VORTEX_HOST_DB_PORT=$(docker compose port mariadb 3306 2>/dev/null | cut -d : -f 2) \
VORTEX_HOST_DB_PORT=$(docker compose port database 3306 2>/dev/null | cut -d : -f 2) \
VORTEX_HOST_SOLR_PORT=$(docker compose port solr 8983 2>/dev/null | cut -d : -f 2) \
VORTEX_HOST_SELENIUM_VNC_PORT=$(docker compose port chrome 7900 2>/dev/null | cut -d : -f 2) \
VORTEX_HOST_HAS_SEQUELACE=$(uname -a | grep -i -q darwin && mdfind -name 'Sequel Ace' 2>/dev/null | grep -q "Ace" && echo 1 || true) \
Expand All @@ -45,8 +45,8 @@ commands:
usage: Open DB in Sequel Ace.
cmd: |
uname -a | grep -i -q darwin && mdfind -name 'Sequel Ace' 2>/dev/null |grep -q "Ace" \
&& VORTEX_HOST_DB_PORT="$(docker port $(docker compose ps -q mariadb 2>/dev/null) 3306 2>/dev/null | cut -d : -f 2)" \
&& open "mysql://${MARIADB_USERNAME:-drupal}:${MARIADB_PASSWORD:-drupal}@127.0.0.1:${VORTEX_HOST_DB_PORT}/drupal" -a "Sequel Ace" \
&& VORTEX_HOST_DB_PORT="$(docker port $(docker compose ps -q database 2>/dev/null) 3306 2>/dev/null | cut -d : -f 2)" \
&& open "mysql://${DATABASE_USERNAME:-drupal}:${DATABASE_PASSWORD:-drupal}@127.0.0.1:${VORTEX_HOST_DB_PORT}/drupal" -a "Sequel Ace" \
|| echo "Not a supported OS or Sequel Ace is not installed."
# ----------------------------------------------------------------------------
Expand Down Expand Up @@ -135,8 +135,8 @@ commands:
usage: Reload the database container using local database image.
cmd: |
ahoy confirm "Running this command will replace your current database. Are you sure?" &&
docker compose rm --force --stop --volumes mariadb && \
ahoy up -- --build mariadb && \
docker compose rm --force --stop --volumes database && \
ahoy up -- --build database && \
ahoy up wait_dependencies && \
sleep 15 && \
ahoy provision && \
Expand Down
2 changes: 1 addition & 1 deletion .docker/cli.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ ENV DRUPAL_CONFIG_PATH=${DRUPAL_CONFIG_PATH}
ENV WEBROOT=${WEBROOT} \
COMPOSER_ALLOW_SUPERUSER=1 \
COMPOSER_CACHE_DIR=/tmp/.composer/cache \
SIMPLETEST_DB=mysql://drupal:drupal@mariadb/drupal \
SIMPLETEST_DB=mysql://drupal:drupal@database/drupal \
SIMPLETEST_BASE_URL=http://nginx:8080 \
SYMFONY_DEPRECATIONS_HELPER=disabled

Expand Down
2 changes: 1 addition & 1 deletion .docker/mariadb.dockerfile → .docker/database.dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# MariaDB container.
# Database container.
#
# @see https://hub.docker.com/r/uselagoon/mariadb-10.11-drupal/tags
# @see https://github.com/uselagoon/lagoon-images/tree/main/images/mariadb-drupal
Expand Down
4 changes: 2 additions & 2 deletions .vortex/docs/content/tools/docker.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -208,9 +208,9 @@ Vortex:
different from the `cli` container in that it does not have certain
development dependencies installed, has a smaller size and is optimised for
scalability.
- `mariadb` - a container that runs a database server. This container is used to
- `database` - a container that runs a database server. This container is used to
store the application data. It can be accessed from the host via a randomly
assigned port - run `docker compose port mariadb 3306` to get the port number.
assigned port - run `docker compose port database 3306` to get the port number.
- `redis` - an optional container that runs a Redis server. This container is
used to store the application cache.
- `solr` - an optional container that runs a Solr server. This container is used
Expand Down
2 changes: 1 addition & 1 deletion .vortex/docs/content/workflows/variables.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -644,7 +644,7 @@ Defined in: `scripts/vortex/export-db-image.sh`

The service name to capture.

Default value: `mariadb`
Default value: `database`

Defined in: `scripts/vortex/export-db-image.sh`

Expand Down
2 changes: 1 addition & 1 deletion .vortex/tests/bats/_helper.bash
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ assert_files_present_vortex() {
pushd "${dir}" >/dev/null || exit 1

assert_file_exists ".docker/cli.dockerfile"
assert_file_exists ".docker/mariadb.dockerfile"
assert_file_exists ".docker/database.dockerfile"
assert_file_exists ".docker/nginx-drupal.dockerfile"
assert_file_exists ".docker/php.dockerfile"
assert_file_exists ".docker/solr.dockerfile"
Expand Down
6 changes: 3 additions & 3 deletions .vortex/tests/bats/_helper.workflow.bash
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ assert_timezone() {
assert_output_contains "AE"
run docker compose exec nginx date
assert_output_contains "AE"
run docker compose exec mariadb date
run docker compose exec database date
assert_output_contains "AE"

# Add variable to the .env file and apply the change to container.
Expand All @@ -254,7 +254,7 @@ assert_timezone() {
assert_output_contains "AWST"
run docker compose exec nginx date
assert_output_contains "AWST"
run docker compose exec mariadb date
run docker compose exec database date
assert_output_contains "AWST"

# Restore file, apply changes and assert that original behaviour has been restored.
Expand Down Expand Up @@ -293,7 +293,7 @@ assert_ahoy_info() {
assert_output_contains "Docker Compose project name : star_wars"
assert_output_contains "Site local URL : http://star_wars.docker.amazee.io"
assert_output_contains "Path to web root : /app/${webroot}"
assert_output_contains "DB host : mariadb"
assert_output_contains "DB host : database"
assert_output_contains "DB username : drupal"
assert_output_contains "DB password : drupal"
assert_output_contains "DB port : 3306"
Expand Down
78 changes: 39 additions & 39 deletions .vortex/tests/bats/fixtures/docker-compose.env.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@
"entrypoint": null,
"environment": {
"CI": "true",
"DATABASE_HOST": "database",
"DATABASE_NAME": "drupal",
"DATABASE_PASSWORD": "drupal",
"DATABASE_PORT": "3306",
"DATABASE_USERNAME": "drupal",
"DRUPAL_CONFIG_PATH": "/app/config/default",
"DRUPAL_PRIVATE_FILES": "/app/web/sites/default/files/private",
"DRUPAL_PUBLIC_FILES": "/app/web/sites/default/files",
Expand All @@ -26,11 +31,6 @@
"DRUPAL_SHIELD_USER": "",
"DRUPAL_TEMPORARY_FILES": "/tmp",
"LAGOON_ROUTE": "star_wars.docker.amazee.io",
"MARIADB_DATABASE": "drupal",
"MARIADB_HOST": "mariadb",
"MARIADB_PASSWORD": "drupal",
"MARIADB_PORT": "3306",
"MARIADB_USERNAME": "drupal",
"TZ": "Australia/Melbourne",
"VORTEX_LOCALDEV_URL": "star_wars.docker.amazee.io",
"XDEBUG_ENABLE": ""
Expand Down Expand Up @@ -74,6 +74,11 @@
"entrypoint": null,
"environment": {
"CI": "true",
"DATABASE_HOST": "database",
"DATABASE_NAME": "drupal",
"DATABASE_PASSWORD": "drupal",
"DATABASE_PORT": "3306",
"DATABASE_USERNAME": "drupal",
"DRUPAL_CONFIG_PATH": "/app/config/default",
"DRUPAL_PRIVATE_FILES": "/app/web/sites/default/files/private",
"DRUPAL_PUBLIC_FILES": "/app/web/sites/default/files",
Expand All @@ -82,11 +87,6 @@
"DRUPAL_SHIELD_USER": "",
"DRUPAL_TEMPORARY_FILES": "/tmp",
"LAGOON_ROUTE": "star_wars.docker.amazee.io",
"MARIADB_DATABASE": "drupal",
"MARIADB_HOST": "mariadb",
"MARIADB_PASSWORD": "drupal",
"MARIADB_PORT": "3306",
"MARIADB_USERNAME": "drupal",
"TZ": "Australia/Melbourne",
"VORTEX_LOCALDEV_URL": "star_wars.docker.amazee.io",
"XDEBUG_ENABLE": ""
Expand Down Expand Up @@ -121,6 +121,11 @@
"entrypoint": null,
"environment": {
"CI": "true",
"DATABASE_HOST": "database",
"DATABASE_NAME": "drupal",
"DATABASE_PASSWORD": "drupal",
"DATABASE_PORT": "3306",
"DATABASE_USERNAME": "drupal",
"DRUPAL_CONFIG_PATH": "/app/config/default",
"DRUPAL_PRIVATE_FILES": "/app/web/sites/default/files/private",
"DRUPAL_PUBLIC_FILES": "/app/web/sites/default/files",
Expand All @@ -129,11 +134,6 @@
"DRUPAL_SHIELD_USER": "",
"DRUPAL_TEMPORARY_FILES": "/tmp",
"LAGOON_ROUTE": "star_wars.docker.amazee.io",
"MARIADB_DATABASE": "drupal",
"MARIADB_HOST": "mariadb",
"MARIADB_PASSWORD": "drupal",
"MARIADB_PORT": "3306",
"MARIADB_USERNAME": "drupal",
"TZ": "Australia/Melbourne",
"VORTEX_LOCALDEV_URL": "star_wars.docker.amazee.io",
"XDEBUG_ENABLE": ""
Expand Down Expand Up @@ -163,18 +163,23 @@
}
]
},
"mariadb": {
"database": {
"build": {
"args": {
"IMAGE": "uselagoon/mariadb-10.11-drupal:VERSION"
},
"context": "FIXTURE_CUR_DIR",
"dockerfile": ".docker/mariadb.dockerfile"
"dockerfile": ".docker/database.dockerfile"
},
"command": null,
"entrypoint": null,
"environment": {
"CI": "true",
"DATABASE_HOST": "database",
"DATABASE_NAME": "drupal",
"DATABASE_PASSWORD": "drupal",
"DATABASE_PORT": "3306",
"DATABASE_USERNAME": "drupal",
"DRUPAL_CONFIG_PATH": "/app/config/default",
"DRUPAL_PRIVATE_FILES": "/app/web/sites/default/files/private",
"DRUPAL_PUBLIC_FILES": "/app/web/sites/default/files",
Expand All @@ -183,11 +188,6 @@
"DRUPAL_SHIELD_USER": "",
"DRUPAL_TEMPORARY_FILES": "/tmp",
"LAGOON_ROUTE": "star_wars.docker.amazee.io",
"MARIADB_DATABASE": "drupal",
"MARIADB_HOST": "mariadb",
"MARIADB_PASSWORD": "drupal",
"MARIADB_PORT": "3306",
"MARIADB_USERNAME": "drupal",
"TZ": "Australia/Melbourne",
"VORTEX_LOCALDEV_URL": "star_wars.docker.amazee.io",
"XDEBUG_ENABLE": ""
Expand Down Expand Up @@ -230,6 +230,11 @@
"entrypoint": null,
"environment": {
"CI": "true",
"DATABASE_HOST": "database",
"DATABASE_NAME": "drupal",
"DATABASE_PASSWORD": "drupal",
"DATABASE_PORT": "3306",
"DATABASE_USERNAME": "drupal",
"DRUPAL_CONFIG_PATH": "/app/config/default",
"DRUPAL_PRIVATE_FILES": "/app/web/sites/default/files/private",
"DRUPAL_PUBLIC_FILES": "/app/web/sites/default/files",
Expand All @@ -238,11 +243,6 @@
"DRUPAL_SHIELD_USER": "",
"DRUPAL_TEMPORARY_FILES": "/tmp",
"LAGOON_ROUTE": "star_wars.docker.amazee.io",
"MARIADB_DATABASE": "drupal",
"MARIADB_HOST": "mariadb",
"MARIADB_PASSWORD": "drupal",
"MARIADB_PORT": "3306",
"MARIADB_USERNAME": "drupal",
"TZ": "Australia/Melbourne",
"VORTEX_LOCALDEV_URL": "star_wars.docker.amazee.io",
"XDEBUG_ENABLE": ""
Expand Down Expand Up @@ -290,6 +290,11 @@
"entrypoint": null,
"environment": {
"CI": "true",
"DATABASE_HOST": "database",
"DATABASE_NAME": "drupal",
"DATABASE_PASSWORD": "drupal",
"DATABASE_PORT": "3306",
"DATABASE_USERNAME": "drupal",
"DRUPAL_CONFIG_PATH": "/app/config/default",
"DRUPAL_PRIVATE_FILES": "/app/web/sites/default/files/private",
"DRUPAL_PUBLIC_FILES": "/app/web/sites/default/files",
Expand All @@ -298,11 +303,6 @@
"DRUPAL_SHIELD_USER": "",
"DRUPAL_TEMPORARY_FILES": "/tmp",
"LAGOON_ROUTE": "star_wars.docker.amazee.io",
"MARIADB_DATABASE": "drupal",
"MARIADB_HOST": "mariadb",
"MARIADB_PASSWORD": "drupal",
"MARIADB_PORT": "3306",
"MARIADB_USERNAME": "drupal",
"TZ": "Australia/Melbourne",
"VORTEX_LOCALDEV_URL": "star_wars.docker.amazee.io",
"XDEBUG_ENABLE": ""
Expand Down Expand Up @@ -361,6 +361,11 @@
"entrypoint": null,
"environment": {
"CI": "true",
"DATABASE_HOST": "database",
"DATABASE_NAME": "drupal",
"DATABASE_PASSWORD": "drupal",
"DATABASE_PORT": "3306",
"DATABASE_USERNAME": "drupal",
"DRUPAL_CONFIG_PATH": "/app/config/default",
"DRUPAL_PRIVATE_FILES": "/app/web/sites/default/files/private",
"DRUPAL_PUBLIC_FILES": "/app/web/sites/default/files",
Expand All @@ -369,11 +374,6 @@
"DRUPAL_SHIELD_USER": "",
"DRUPAL_TEMPORARY_FILES": "/tmp",
"LAGOON_ROUTE": "star_wars.docker.amazee.io",
"MARIADB_DATABASE": "drupal",
"MARIADB_HOST": "mariadb",
"MARIADB_PASSWORD": "drupal",
"MARIADB_PORT": "3306",
"MARIADB_USERNAME": "drupal",
"TZ": "Australia/Melbourne",
"VORTEX_LOCALDEV_URL": "star_wars.docker.amazee.io",
"XDEBUG_ENABLE": ""
Expand Down Expand Up @@ -402,7 +402,7 @@
},
"wait_dependencies": {
"command": [
"mariadb:3306",
"database:3306",
"clamav:3310"
],
"depends_on": {
Expand All @@ -414,7 +414,7 @@
"condition": "service_started",
"required": true
},
"mariadb": {
"database": {
"condition": "service_started",
"required": true
}
Expand Down
Loading

1 comment on commit a55a133

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.