Skip to content

Commit

Permalink
Merge branch 'develop' into feature/1296-remove-Docker-references
Browse files Browse the repository at this point in the history
# Conflicts:
#	.circleci/config.yml
#	.env
#	.scaffold/docs/content/workflows/variables.mdx
#	.scaffold/tests/bats/install.initial.bats
#	.scaffold/tests/bats/workflow.storage.image.bats
#	.scaffold/tests/bats/workflow.storage.image_cached.bats
#	docker-compose.yml
#	scripts/drevops/download-db-container-registry.sh
#	scripts/drevops/download-db.sh
#	scripts/drevops/export-db.sh
#	scripts/drevops/info.sh
#	scripts/drevops/provision.sh
  • Loading branch information
AlexSkrypnyk committed Apr 30, 2024
2 parents c18aee1 + 4adcb05 commit 44f9738
Show file tree
Hide file tree
Showing 13 changed files with 66 additions and 62 deletions.
6 changes: 3 additions & 3 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ jobs:
# Execute commands after database download script finished: if the
# DB dump was downloaded - build the site (to ensure that the DB dump
# is valid) and export the DB using selected method (to support
# "file-to-container image" or "container image-to-file" conversions).
# "file-to-image" or "image-to-file" conversions).
# Note that configuration changes and the DB updates are not applied, so
# the database will be cached in the same state as downloaded.
- run:
Expand Down Expand Up @@ -196,7 +196,7 @@ jobs:
# Enforce fresh DB build (do not rely on fallback caches).
DREVOPS_CI_DB_CACHE_FALLBACK: 'no'
# Always use fresh base image for the database.
DREVOPS_DB_IMAGE_BASE: drevops/mariadb-drupal-data:24.3.0
DREVOPS_DB_IMAGE_BASE: drevops/mariadb-drupal-data:24.4.0
# Deploy container image (if DREVOPS_DB_EXPORT_IMAGE storage is used).
DREVOPS_EXPORT_DB_CONTAINER_REGISTRY_DEPLOY_PROCEED: 1
#;> !PROVISION_USE_PROFILE
Expand Down Expand Up @@ -523,7 +523,7 @@ workflows:
# - release/2023-04-17, release/2023-04-17.123 (date-based)
# - hotfix/123.456.789, hotfix/123.456.789-rc.1213 (per https://semver.org/)
# - hotfix/2023-04-17, hotfix/2023-04-17.123 (date-based)
only: /^(main|master|develop)$|^feature\/[a-zA-Z0-9\-\.\,]+|^ci.*|^deps\/.*|^(release|hotfix)\/[0-9]+(\.[0-9]+){2}(-rc\.[0-9]+)?$|^(release|hotfix)\/[0-9]{4}-[0-9]{2}-[0-9]{2}(\.[0-9]+)?$/
only: /^(main|master|develop)$|^feature\/[a-zA-Z0-9\-\.\,_]+$|^ci.*|^deps\/.*|^(release|hotfix)\/[0-9]+(\.[0-9]+){2}(-rc\.[0-9]+)?$|^(release|hotfix)\/[0-9]{4}-[0-9]{2}-[0-9]{2}(\.[0-9]+)?$/
tags:
ignore: /.*/
- deploy-tags:
Expand Down
4 changes: 2 additions & 2 deletions .docker/mariadb.dockerfile
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# MariaDB container.
#
# @see https://hub.docker.com/r/uselagoon/mariadb-drupal/tags?page=1
# @see https://hub.docker.com/r/uselagoon/mariadb-10.11-drupal/tags?page=1
# @see https://github.com/uselagoon/lagoon-images/tree/main/images/mariadb-drupal
#
# Use drevops/drevops-mariadb-drupal-data as a starting container image for your
# Database-in-Docker-image database.
# @see https://github.com/drevops/mariadb-drupal-data
#
# The ARG value will be updated with a value passed from docker-compose.yml
ARG IMAGE=uselagoon/mariadb-drupal:24.4.0
ARG IMAGE=uselagoon/mariadb-10.11-drupal:24.4.0

# hadolint ignore=DL3006
FROM ${IMAGE}
Expand Down
48 changes: 24 additions & 24 deletions .scaffold/docs/content/workflows/variables.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -46,25 +46,25 @@ The password (token) to log into the Docker registry.

Default value: `UNDEFINED`

Defined in: `.env.local.default`, `scripts/drevops/deploy-docker.sh`, `scripts/drevops/download-db-docker-registry.sh`, `scripts/drevops/login-container-registry.sh`
Defined in: `.env.local.default`, `scripts/drevops/deploy-docker.sh`, `scripts/drevops/download-db-docker-registry.sh`, `scripts/drevops/login-docker.sh`

### `CONTAINER_REGISTRY`
### `DOCKER_REGISTRY`

Docker registry name.

Provide port, if required as `<server_name>:<port>`.

Default value: `docker.io`

Defined in: `.env`, `scripts/drevops/deploy-docker.sh`, `scripts/drevops/download-db-docker-registry.sh`, `scripts/drevops/login-container-registry.sh`
Defined in: `.env`, `scripts/drevops/deploy-docker.sh`, `scripts/drevops/download-db-docker-registry.sh`, `scripts/drevops/login-docker.sh`

### `DOCKER_USER`

The username to log into the Docker registry.

Default value: `UNDEFINED`

Defined in: `.env.local.default`, `scripts/drevops/deploy-docker.sh`, `scripts/drevops/download-db-docker-registry.sh`, `scripts/drevops/login-container-registry.sh`
Defined in: `.env.local.default`, `scripts/drevops/deploy-docker.sh`, `scripts/drevops/download-db-docker-registry.sh`, `scripts/drevops/login-docker.sh`

### `DREVOPS_ACQUIA_APP_NAME`

Expand Down Expand Up @@ -334,7 +334,7 @@ Defined in: `scripts/drevops/download-db-lagoon.sh`

### `DREVOPS_DB_DOWNLOAD_SOURCE`

Note that "container_registry" works only for database-in-Docker-image<br />database storage (when [`$DREVOPS_DB_IMAGE`](#drevops_db_image) variable has a value).
Note that "docker_registry" works only for database-in-Docker-image<br />database storage (when [`$DREVOPS_DB_IMAGE`](#drevops_db_image) variable has a value).

Default value: `curl`

Expand All @@ -356,45 +356,45 @@ Default value: `UNDEFINED`

Defined in: `scripts/drevops/download-db-lagoon.sh`

### `DREVOPS_DB_EXPORT_IMAGE_ARCHIVE_FILE`
### `DREVOPS_DB_EXPORT_DOCKER_ARCHIVE_FILE`

container image archive file name.
Docker image archive file name.

Default value: `UNDEFINED`

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

### `DREVOPS_DB_EXPORT_IMAGE_DIR`
### `DREVOPS_DB_EXPORT_DOCKER_DIR`

Directory with database image archive file.

Default value: `${DREVOPS_DB_DIR}`

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

### `DREVOPS_DB_EXPORT_IMAGE`
### `DREVOPS_DB_EXPORT_DOCKER_IMAGE`

container image to store in a form of `<org>/<repository>`.
Docker image to store in a form of `<org>/<repository>`.

Default value: `UNDEFINED`

Defined in: `scripts/drevops/export-db-image.sh`, `scripts/drevops/export-db.sh`
Defined in: `scripts/drevops/export-db-docker.sh`, `scripts/drevops/export-db.sh`

### `DREVOPS_DB_EXPORT_CONTAINER_REGISTRY`
### `DREVOPS_DB_EXPORT_DOCKER_REGISTRY`

Docker registry name.

Default value: `docker.io`

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

### `DREVOPS_DB_EXPORT_SERVICE_NAME`
### `DREVOPS_DB_EXPORT_DOCKER_SERVICE_NAME`

The service name to capture.

Default value: `mariadb`

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

### `DREVOPS_DB_EXPORT_FILE_DIR`

Expand All @@ -414,7 +414,7 @@ Defined in: `.env`, `scripts/drevops/download-db-acquia.sh`, `scripts/drevops/do

### `DREVOPS_DB_IMAGE`

Name of the database container image to use.
Name of the database docker image to use.

See https://github.com/drevops/mariadb-drupal-data to seed your DB image.

Expand All @@ -424,7 +424,7 @@ Defined in: `.env`, `scripts/drevops/download-db-docker-registry.sh`, `scripts/d

### `DREVOPS_DB_IMAGE_BASE`

Name of the database fall-back container image to use.
Name of the database fall-back docker image to use.

If the image specified in [`$DREVOPS_DB_IMAGE`](#drevops_db_image) does not exist and base<br />image was provided - it will be used as a "clean slate" for the database.

Expand Down Expand Up @@ -525,7 +525,7 @@ Default value: `UNDEFINED`

Defined in: `scripts/drevops/deploy-lagoon.sh`, `scripts/drevops/deploy.sh`

### `DREVOPS_DEPLOY_CONTAINER_MAP`
### `DREVOPS_DEPLOY_DOCKER_MAP`

Comma-separated map of docker services and images to use for deployment in<br />format "service1=org/image1,service2=org/image2".

Expand Down Expand Up @@ -651,7 +651,7 @@ Default value: `UNDEFINED`

Defined in: `scripts/drevops/deploy-webhook.sh`

### `DREVOPS_CONTAINER_IMAGE_TAG`
### `DREVOPS_DOCKER_IMAGE_TAG`

The tag of the image to push to.

Expand Down Expand Up @@ -733,9 +733,9 @@ Default value: `UNDEFINED`

Defined in: `CI config`

### `DREVOPS_EXPORT_DB_CONTAINER_REGISTRY_DEPLOY_PROCEED`
### `DREVOPS_EXPORT_DB_DOCKER_DEPLOY_PROCEED`

Proceed with container image deployment after it was exported.
Proceed with Docker image deployment after it was exported.

Default value: `UNDEFINED`

Expand Down Expand Up @@ -1139,7 +1139,7 @@ Defined in: `scripts/drevops/notify.sh`

### `DREVOPS_NOTIFY_WEBHOOK_HEADERS`

Webhook headers.<br />Ex: "Content-type: application/json;Authorization: Bearer API_KEY".
Webhook headers.<br />Separate multiple headers with a pipe `|`.<br />Example: `Content-type: application/json|Authorization: Bearer API_KEY`.

Default value: `Content-type: application/json`

Expand Down
2 changes: 1 addition & 1 deletion .scaffold/tests/bats/fixtures/docker-compose.env.json
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@
"mariadb": {
"build": {
"args": {
"IMAGE": "uselagoon/mariadb-drupal:VERSION"
"IMAGE": "uselagoon/mariadb-10.11-drupal:VERSION"
},
"context": "FIXTURE_CUR_DIR",
"dockerfile": ".docker/mariadb.dockerfile"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@
"mariadb": {
"build": {
"args": {
"IMAGE": "uselagoon/mariadb-drupal:VERSION"
"IMAGE": "uselagoon/mariadb-10.11-drupal:VERSION"
},
"context": "FIXTURE_CUR_DIR",
"dockerfile": ".docker/mariadb.dockerfile"
Expand Down
2 changes: 1 addition & 1 deletion .scaffold/tests/bats/fixtures/docker-compose.noenv.json
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@
"mariadb": {
"build": {
"args": {
"IMAGE": "uselagoon/mariadb-drupal:VERSION"
"IMAGE": "uselagoon/mariadb-10.11-drupal:VERSION"
},
"context": "FIXTURE_CUR_DIR",
"dockerfile": ".docker/mariadb.dockerfile"
Expand Down
50 changes: 25 additions & 25 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,44 +15,44 @@
],
"require": {
"php": ">=8.2",
"composer/installers": "^2.1",
"composer/installers": "^2.2",
"cweagans/composer-patches": "^1.7",
"drupal/admin_toolbar": "^3.1",
"drupal/clamav": "^2.0.2",
"drupal/coffee": "^1.2",
"drupal/config_split": "^1",
"drupal/admin_toolbar": "^3.4",
"drupal/clamav": "^2.0",
"drupal/coffee": "^1.4",
"drupal/config_split": "^1.9",
"drupal/config_update": "^2@alpha",
"drupal/core-composer-scaffold": "^10.2.0",
"drupal/core-recommended": "^10.2.0",
"drupal/core-composer-scaffold": "^10.2",
"drupal/core-recommended": "^10.2",
"drupal/environment_indicator": "^4.0",
"drupal/pathauto": "^1.10",
"drupal/redirect": "^1.7",
"drupal/redis": "^1.6",
"drupal/search_api": "^1.29",
"drupal/search_api_solr": "^4.2",
"drupal/shield": "^1.6",
"drupal/stage_file_proxy": "^2",
"drush/drush": "^12",
"drupal/pathauto": "^1.12",
"drupal/redirect": "^1.9",
"drupal/redis": "^1.7",
"drupal/search_api": "^1.34",
"drupal/search_api_solr": "^4.3",
"drupal/shield": "^1.7",
"drupal/stage_file_proxy": "^2.1",
"drush/drush": "^12.5",
"oomphinc/composer-installers-extender": "^2.0",
"vlucas/phpdotenv": "^5.1",
"vlucas/phpdotenv": "^5.6",
"webflo/drupal-finder": "^1.2"
},
"require-dev": {
"behat/behat": "^3.10",
"behat/behat": "^3.14",
"dealerdirect/phpcodesniffer-composer-installer": "^0.7",
"drevops/behat-format-progress-fail": "^1",
"drevops/behat-screenshot": "^1",
"drevops/behat-steps": "^2.2",
"drupal/core-dev": "^10.2.0",
"drevops/behat-format-progress-fail": "^1.2",
"drevops/behat-screenshot": "^1.5",
"drevops/behat-steps": "^2.3",
"drupal/core-dev": "^10.2",
"drupal/drupal-extension": "^5",
"mglaman/phpstan-drupal": "^1.2",
"palantirnet/drupal-rector": "^0.20",
"phpcompatibility/php-compatibility": "^9.3",
"phpmd/phpmd": "^2.13",
"phpspec/prophecy-phpunit": "^2.0",
"phpmd/phpmd": "^2.15",
"phpspec/prophecy-phpunit": "^2.2",
"phpstan/extension-installer": "^1.3",
"pyrech/composer-changelogs": "^1.8",
"vincentlanglet/twig-cs-fixer": "^2.4"
"vincentlanglet/twig-cs-fixer": "^2.8"
},
"conflict": {
"drupal/drupal": "*"
Expand All @@ -73,7 +73,7 @@
"pyrech/composer-changelogs": true
},
"platform": {
"php": "8.2.17"
"php": "8.2.18"
}
},
"autoload": {
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ services:
context: .
dockerfile: .docker/mariadb.dockerfile
args:
IMAGE: "${DREVOPS_DB_IMAGE:-uselagoon/mariadb-drupal:24.3.1}" # Use custom database image (if defined) or fallback to standard database image.
IMAGE: "${DREVOPS_DB_IMAGE:-uselagoon/mariadb-drupal:24.4.0}" # Use custom database image (if defined) or fallback to standard database image.
<<: *default-user
environment:
<<: *default-environment
Expand Down
2 changes: 1 addition & 1 deletion scripts/drevops/download-db-container-registry.sh
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ if [ -f "${DREVOPS_DB_DIR}/db.tar" ]; then

# Check that image was expanded and now exists on the host or notify
# that it will be downloaded from the registry.
if container image inspect "${DREVOPS_DB_IMAGE}" >/dev/null 2>&1; then
if docker image inspect "${DREVOPS_DB_IMAGE}" >/dev/null 2>&1; then
note "Found expanded ${DREVOPS_DB_IMAGE} image on host."
image_expanded_successfully=1
else
Expand Down
2 changes: 1 addition & 1 deletion scripts/drevops/info.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ note "DB password : ${MARIADB_PASSWORD}"
note "DB port : ${MARIADB_PORT}"
note "DB port on host : ${DREVOPS_HOST_DB_PORT} ${sequelace}"
if [ -n "${DREVOPS_DB_IMAGE:-}" ]; then
note "DB-in-container image : ${DREVOPS_DB_IMAGE}"
note "DB-in-image : ${DREVOPS_DB_IMAGE}"

Check warning on line 42 in scripts/drevops/info.sh

View check run for this annotation

Codecov / codecov/patch

scripts/drevops/info.sh#L42

Added line #L42 was not covered by tests
fi
if [ -n "${DREVOPS_HOST_SOLR_PORT:-}" ]; then
note "Solr URL on host : http://127.0.0.1:${DREVOPS_HOST_SOLR_PORT}"
Expand Down
3 changes: 2 additions & 1 deletion scripts/drevops/notify-webhook.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ DREVOPS_NOTIFY_WEBHOOK_URL="${DREVOPS_NOTIFY_WEBHOOK_URL:-}"
DREVOPS_NOTIFY_WEBHOOK_METHOD="${DREVOPS_NOTIFY_WEBHOOK_METHOD:-POST}"

# Webhook headers.
# Ex: "Content-type: application/json;Authorization: Bearer API_KEY".
# Separate multiple headers with a pipe `|`.
# Example: `Content-type: application/json|Authorization: Bearer API_KEY`.
DREVOPS_NOTIFY_WEBHOOK_HEADERS="${DREVOPS_NOTIFY_WEBHOOK_HEADERS:-Content-type: application/json}"

# Webhook message body as json format.
Expand Down
2 changes: 1 addition & 1 deletion scripts/drevops/provision.sh
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ note "Private files directory : ${DREVOPS_DRUPAL_PRIVATE_FILES}"
note "Config path : ${DREVOPS_DRUPAL_CONFIG_PATH}"
note "DB dump file path : ${DREVOPS_DB_DIR}/${DREVOPS_DB_FILE} ($([ -f "${DREVOPS_DB_DIR}/${DREVOPS_DB_FILE}" ] && echo "present" || echo "absent"))"
if [ -n "${DREVOPS_DB_IMAGE:-}" ]; then
note "DB dump container image : ${DREVOPS_DB_IMAGE}"
note "DB dump container image : ${DREVOPS_DB_IMAGE}"

Check warning on line 99 in scripts/drevops/provision.sh

View check run for this annotation

Codecov / codecov/patch

scripts/drevops/provision.sh#L99

Added line #L99 was not covered by tests
fi
echo
note "Drush version : ${drush_version}"
Expand Down
3 changes: 3 additions & 0 deletions tests/phpunit/CircleCiConfigTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,11 @@ public function dataProviderDeployBranchRegex(): array {
['feature/description'],
['feature/Description'],
['feature/Description-With-Hyphens'],
['feature/Description-With_Underscores'],
['feature/123-description'],
['feature/123-Description'],
['feature/UNDERSCORES_UNDERSCORES'],
['feature/123-Description-With_UNDERSCORES'],
['feature/1.x'],
['feature/0.x'],
['feature/0.1.x'],
Expand Down

1 comment on commit 44f9738

@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.