From 7592eaa3c9a91dfba79bb70cec47bcebd9457fee Mon Sep 17 00:00:00 2001 From: Steve Worley Date: Wed, 10 Jan 2024 08:59:52 +1000 Subject: [PATCH 01/11] Add aliases for drush and composer. --- .docker/Dockerfile.govcms | 6 +++--- .../govcms/entrypoints/55-cli-helpers.sh | 21 +++++++++++++++++++ 2 files changed, 24 insertions(+), 3 deletions(-) create mode 100644 .docker/images/govcms/entrypoints/55-cli-helpers.sh diff --git a/.docker/Dockerfile.govcms b/.docker/Dockerfile.govcms index 4e27c49f6..32965ff0b 100644 --- a/.docker/Dockerfile.govcms +++ b/.docker/Dockerfile.govcms @@ -28,13 +28,13 @@ COPY scripts/composer/ScriptHandler.php /app/scripts/composer/ScriptHandler.php ENV COMPOSER_MEMORY_LIMIT=-1 # Set the Github OAuth token only when the variable is set. RUN [[ ! -z "${GITHUB_TOKEN}" ]] && composer config -g github-oauth.github.com ${GITHUB_TOKEN} || echo "Personal Github OAuth token is not set." + RUN composer validate \ - && composer self-update --2 \ && composer update -d /app \ && composer clearcache -# Override global Drush8 with Drush12. -ENV PATH="/app/vendor/bin:${PATH}" +# Add bash aliases to assist with full path executables. +COPY .docker/images/govcms/entrypoints /lagoon/entrypoints/ COPY .docker/sanitize.sh /app/sanitize.sh diff --git a/.docker/images/govcms/entrypoints/55-cli-helpers.sh b/.docker/images/govcms/entrypoints/55-cli-helpers.sh new file mode 100644 index 000000000..75e21d466 --- /dev/null +++ b/.docker/images/govcms/entrypoints/55-cli-helpers.sh @@ -0,0 +1,21 @@ +#!/bin/sh + +# Provide aliases to help with general operations. +# The default uselagoon bashrc skips the standard .bash_aliases include +# so we override this file and include our aliases here. +# +# @see https://github.com/uselagoon/lagoon-images/blob/main/images/php-cli/entrypoints/55-cli-helpers.sh + +dsql () { + drush sql-sync $1 @self +} + +dfiles () { + drush rsync $1:%files @self:%files +} + +# end Lagoon helpers. + +# Ensure absolute paths are used. +alias composer=/usr/local/bin/composer +alias drush=/app/vendor/bin/drush From 8c302607d4b00810924764f950cbc6b4b2797ba9 Mon Sep 17 00:00:00 2001 From: Steve Worley Date: Wed, 10 Jan 2024 09:01:05 +1000 Subject: [PATCH 02/11] Add missing composer update. --- .docker/Dockerfile.govcms | 1 + 1 file changed, 1 insertion(+) diff --git a/.docker/Dockerfile.govcms b/.docker/Dockerfile.govcms index 32965ff0b..5b02dfdb8 100644 --- a/.docker/Dockerfile.govcms +++ b/.docker/Dockerfile.govcms @@ -30,6 +30,7 @@ ENV COMPOSER_MEMORY_LIMIT=-1 RUN [[ ! -z "${GITHUB_TOKEN}" ]] && composer config -g github-oauth.github.com ${GITHUB_TOKEN} || echo "Personal Github OAuth token is not set." RUN composer validate \ + && composer self-update --2 \ && composer update -d /app \ && composer clearcache From cd9f366a847435aeb98cecb76c9cd651d5c5e049 Mon Sep 17 00:00:00 2001 From: Sonny Kieu Date: Mon, 15 Jan 2024 18:23:27 +1100 Subject: [PATCH 03/11] [DEVOPS-394] Upgraded to docker compose v2. --- .ahoy.yml | 48 +++++++++---------- .docker/images/nginx/tests/bootstrap.php | 4 +- .../images/nginx/tests/src/FilesCacheTest.php | 4 +- .../nginx/tests/src/PrivateFilesTest.php | 4 +- .env.default | 2 +- .gitlab-ci.yml | 4 +- docker-compose.yml | 4 +- 7 files changed, 35 insertions(+), 35 deletions(-) diff --git a/.ahoy.yml b/.ahoy.yml index 09669772c..04e4b4a15 100644 --- a/.ahoy.yml +++ b/.ahoy.yml @@ -5,12 +5,12 @@ commands: up: usage: Build project. cmd: | - docker-compose up -d "$@" && - docker-compose exec -T test dockerize -wait tcp://mariadb:3306 -timeout 2m; + docker compose up -d "$@" && + docker compose exec -T test dockerize -wait tcp://mariadb:3306 -timeout 2m; down: usage: Delete project. - cmd: docker-compose down + cmd: docker compose down build: usage: Build project locally (single-local architecture only). @@ -19,15 +19,15 @@ commands: if [ "$1" == "y" ]; then env $(cat .env | grep -v "#" | xargs) docker buildx bake -f docker-compose.yml --no-cache cli --load env $(cat .env | grep -v "#" | xargs) docker buildx bake -f docker-compose.yml --load - docker-compose up -d - docker-compose exec -T test dockerize -wait tcp://mariadb:3306 -timeout 2m + docker compose up -d + docker compose exec -T test dockerize -wait tcp://mariadb:3306 -timeout 2m else ahoy confirm "Are you sure environment variables are correct? Update .env if not." && # Run this if confirm returns true env $(cat .env | grep -v "#" | xargs) docker buildx bake -f docker-compose.yml --no-cache cli --load && env $(cat .env | grep -v "#" | xargs) docker buildx bake -f docker-compose.yml --load && - docker-compose up -d "$@" && - docker-compose exec -T test dockerize -wait tcp://mariadb:3306 -timeout 2m || + docker compose up -d "$@" && + docker compose exec -T test dockerize -wait tcp://mariadb:3306 -timeout 2m || # Run this if confirm returns false echo "OK, nothing to do." fi @@ -51,39 +51,39 @@ commands: cli: usage: Start a shell inside TEST container. - cmd: docker-compose exec cli bash + cmd: docker compose exec cli bash run: usage: Run command inside TEST container. - cmd: docker-compose exec -T cli bash -c "$@" + cmd: docker compose exec -T cli bash -c "$@" drush: usage: Run drush commands in TEST container. - cmd: docker-compose exec -T cli drush "$@" + cmd: docker compose exec -T cli drush "$@" logs: usage: Show Docker logs. - cmd: docker-compose logs "$@" + cmd: docker compose logs "$@" ps: usage: List running Docker containers. - cmd: docker-compose ps + cmd: docker compose ps restart: usage: Restart Docker containers. - cmd: docker-compose restart + cmd: docker compose restart stop: usage: Stop Docker containers. - cmd: docker-compose stop "$@" + cmd: docker compose stop "$@" install: usage: Install the profile. - cmd: docker-compose exec -T cli drush si -y govcms "$@" + cmd: docker compose exec -T cli drush si -y govcms "$@" login: usage: Login to a website. - cmd: docker-compose exec -T cli drush uli "$@" + cmd: docker compose exec -T cli drush uli "$@" pull: usage: Pull latest docker images. @@ -91,11 +91,11 @@ commands: audit-site: usage: Run site audit - cmd: docker-compose exec -T cli drutiny profile:run d8-full @self "$@" + cmd: docker compose exec -T cli drutiny profile:run d8-full @self "$@" lint: usage: Lint code - cmd: docker-compose exec cli lint-govcms + cmd: docker compose exec cli lint-govcms test: usage: Run all tests. @@ -105,18 +105,18 @@ commands: test-behat: usage: Run Behat tests. - cmd: docker-compose exec cli behat "$@" + cmd: docker compose exec cli behat "$@" test-phpunit: usage: Run PHPUnit tests. - cmd: docker-compose exec cli phpunit --testsuite govcms + cmd: docker compose exec cli phpunit --testsuite govcms test-redis: usage: Verify redis can accept connections. cmd: | ahoy -v install - docker-compose exec -T --env ENABLE_REDIS=true cli drush status - if [ $(docker-compose exec -T redis redis-cli KEYS '*' | wc -l) -le 1 ]; then + docker compose exec -T --env ENABLE_REDIS=true cli drush status + if [ $(docker compose exec -T redis redis-cli KEYS '*' | wc -l) -le 1 ]; then echo 'Redis fail: No valid cache keys.' exit 1 else @@ -133,8 +133,8 @@ commands: test-nginx: usage: Validate the nginx image. cmd: | - docker-compose exec -T test dockerize -wait tcp://nginx:8080 -timeout 1m - docker-compose exec -T nginx nginx -t + docker compose exec -T test dockerize -wait tcp://nginx:8080 -timeout 1m + docker compose exec -T nginx nginx -t composer validate --strict -d .docker/images/nginx/tests composer install -d .docker/images/nginx/tests .docker/images/nginx/tests/vendor/bin/phpunit -c .docker/images/nginx/tests/phpunit.xml diff --git a/.docker/images/nginx/tests/bootstrap.php b/.docker/images/nginx/tests/bootstrap.php index 8163181a6..896ebc45d 100644 --- a/.docker/images/nginx/tests/bootstrap.php +++ b/.docker/images/nginx/tests/bootstrap.php @@ -25,7 +25,7 @@ function get_curl_headers($path = '/', $opts = NULL) { $uri = $uri . '/' . ltrim($path, '/'); $response = NULL; - exec("docker-compose exec -T test curl -s {$uri} -I {$opts} 2>&1", $response, $ret); + exec("docker compose exec -T test curl -s {$uri} -I {$opts} 2>&1", $response, $ret); if (is_debug()) { fwrite(STDERR, sprintf('CURL exit code : %s', $ret) . PHP_EOL); @@ -75,7 +75,7 @@ function curl_get_content($path = '/', $opts = NULL) { $uri = $uri . '/' . ltrim($path, '/'); $response = NULL; - exec("docker-compose exec -T test curl -s {$uri} {$opts} 2>&1", $response, $ret); + exec("docker compose exec -T test curl -s {$uri} {$opts} 2>&1", $response, $ret); if (is_debug()) { fwrite(STDERR, sprintf('CURL exit code : %s', $ret) . PHP_EOL); diff --git a/.docker/images/nginx/tests/src/FilesCacheTest.php b/.docker/images/nginx/tests/src/FilesCacheTest.php index eb8bcc42d..eac67a10f 100644 --- a/.docker/images/nginx/tests/src/FilesCacheTest.php +++ b/.docker/images/nginx/tests/src/FilesCacheTest.php @@ -10,10 +10,10 @@ class FilesCacheTest extends TestCase { * {@inheritdoc} */ public function setUp(): void { - `docker-compose exec nginx mkdir -p /app/sites/default/files`; + `docker compose exec nginx mkdir -p /app/sites/default/files`; foreach ($this->providerExpiredHeaderPath() as $parts) { list($file, $path) = $parts; - `docker cp $path/$file $(docker-compose ps -q nginx):/app/web/sites/default/files/`; + `docker cp $path/$file $(docker compose ps -q nginx):/app/web/sites/default/files/`; } } diff --git a/.docker/images/nginx/tests/src/PrivateFilesTest.php b/.docker/images/nginx/tests/src/PrivateFilesTest.php index 9731ca139..e36b9a1e4 100644 --- a/.docker/images/nginx/tests/src/PrivateFilesTest.php +++ b/.docker/images/nginx/tests/src/PrivateFilesTest.php @@ -14,11 +14,11 @@ class PrivateFilesTest extends TestCase { */ public function setUp(): void { // Make sure private files directory exists in the nginx container. - `docker-compose exec nginx mkdir -p /app/web/sites/default/files/private`; + `docker compose exec nginx mkdir -p /app/web/sites/default/files/private`; foreach ($this->providerFileAccess() as $parts) { list($file, $path) = $parts; // Move out test files. - `docker cp $path/$file $(docker-compose ps -q nginx):/app/web/sites/default/files/private/`; + `docker cp $path/$file $(docker compose ps -q nginx):/app/web/sites/default/files/private/`; } } diff --git a/.env.default b/.env.default index f1c6c05f2..dfc52a780 100644 --- a/.env.default +++ b/.env.default @@ -3,7 +3,7 @@ # # It is used by Ahoy and other scripts to read default values. # -# Copy this file to '.env' to make docker-compose use overridden values. +# Copy this file to '.env' to make docker compose use overridden values. # Current site name. All containers will have this prefix. COMPOSE_PROJECT_NAME=govcmslagoon diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 4a6c1fdd0..b3a41711d 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -120,7 +120,7 @@ deploy:multiarch: validate:images: stage: validate script: - - docker-compose config -q + - docker compose config -q build:images: stage: build @@ -138,7 +138,7 @@ info:modules: <<: *before_script_build script: - ahoy -v install -- install_configure_form.update_status_module='array(FALSE,FALSE)' - - docker-compose exec -T cli drush status + - docker compose exec -T cli drush status # @todo: 10.x support. #- /govcms/vendor/bin/govcms-module_verify only: diff --git a/docker-compose.yml b/docker-compose.yml index b644a2125..86b22bd46 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -71,7 +71,7 @@ services: LAGOON_IMAGE_VERSION: ${LAGOON_IMAGE_VERSION:-latest} image: ${DOCKERHUB_NAMESPACE:-govcms}/mariadb-drupal:${GOVCMS_RELEASE_TAG:-latest} ports: - - "3306" # Find port on host with `docker-compose port mariadb 3306` + - "3306" # Find port on host with `docker compose port mariadb 3306` redis: build: @@ -91,7 +91,7 @@ services: LAGOON_IMAGE_VERSION: ${LAGOON_IMAGE_VERSION:-latest} image: ${DOCKERHUB_NAMESPACE:-govcms}/solr:${GOVCMS_RELEASE_TAG:-latest} ports: - - "8983" # Find port on host with `docker-compose port solr 8983` + - "8983" # Find port on host with `docker compose port solr 8983` varnish: build: From d0773e834c74c7734c894c02e37d9123c13d3f4e Mon Sep 17 00:00:00 2001 From: Ali-Haider-24 <158018297+Ali-Haider-24@users.noreply.github.com> Date: Fri, 31 May 2024 11:42:37 +1000 Subject: [PATCH 04/11] [GOVCMS-10460] Prepare GovCMS(10) Lagoon Image Release --- .env.default | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.env.default b/.env.default index 3e0f0ea17..1f0cffdbc 100644 --- a/.env.default +++ b/.env.default @@ -35,7 +35,7 @@ X_FRAME_OPTIONS=SAMEORIGIN # Set the version of GovCMS and Drupal Core to use - you can use a tag or branch reference (3.x-dev) here # See https://github.com/govCMS/GovCMS/releases -GOVCMS_PROJECT_VERSION=3.12.0 +GOVCMS_PROJECT_VERSION=dev-release/3.x/3.13.0 # Set the Lagoon tag to use for the upstream dockerfiles (e.g. 20.12.0) # See https://github.com/uselagoon/lagoon-images/releases From 01cd794728adf39be478cd8263c2e5f6c59125c4 Mon Sep 17 00:00:00 2001 From: Su Date: Fri, 14 Jun 2024 14:32:58 +1000 Subject: [PATCH 05/11] [GOVCMSD10-859] prepare GovCMS(10) Lagoon Image Release --- .env.default | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.env.default b/.env.default index c8a087a99..06c1fa97b 100644 --- a/.env.default +++ b/.env.default @@ -35,7 +35,7 @@ X_FRAME_OPTIONS=SAMEORIGIN # Set the version of GovCMS and Drupal Core to use - you can use a tag or branch reference (3.x-dev) here # See https://github.com/govCMS/GovCMS/releases -GOVCMS_PROJECT_VERSION=3.12.0 +GOVCMS_PROJECT_VERSION=dev-release/3.x/3.14.0 # Set the Lagoon tag to use for the upstream dockerfiles (e.g. 20.12.0) # See https://github.com/uselagoon/lagoon-images/releases From 72b4f3de05227424429c12d432d24bbd2717ac03 Mon Sep 17 00:00:00 2001 From: Stuart Rowlands Date: Tue, 18 Jun 2024 02:21:29 +1000 Subject: [PATCH 06/11] Use release tag for 3.13.0. --- .env.default | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.env.default b/.env.default index 1f0cffdbc..fcf70fff5 100644 --- a/.env.default +++ b/.env.default @@ -35,7 +35,7 @@ X_FRAME_OPTIONS=SAMEORIGIN # Set the version of GovCMS and Drupal Core to use - you can use a tag or branch reference (3.x-dev) here # See https://github.com/govCMS/GovCMS/releases -GOVCMS_PROJECT_VERSION=dev-release/3.x/3.13.0 +GOVCMS_PROJECT_VERSION=3.13.0 # Set the Lagoon tag to use for the upstream dockerfiles (e.g. 20.12.0) # See https://github.com/uselagoon/lagoon-images/releases From 7dda7be46ece95ff935128ce44dd166ea41745b4 Mon Sep 17 00:00:00 2001 From: ruwanl Date: Wed, 26 Jun 2024 17:50:23 +1000 Subject: [PATCH 07/11] Hotfix release --- .env.default | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.env.default b/.env.default index 06c1fa97b..3b95251e7 100644 --- a/.env.default +++ b/.env.default @@ -35,11 +35,11 @@ X_FRAME_OPTIONS=SAMEORIGIN # Set the version of GovCMS and Drupal Core to use - you can use a tag or branch reference (3.x-dev) here # See https://github.com/govCMS/GovCMS/releases -GOVCMS_PROJECT_VERSION=dev-release/3.x/3.14.0 +GOVCMS_PROJECT_VERSION=dev-release/3.x/3.13.1 # Set the Lagoon tag to use for the upstream dockerfiles (e.g. 20.12.0) # See https://github.com/uselagoon/lagoon-images/releases -LAGOON_IMAGE_VERSION=24.6.0 +LAGOON_IMAGE_VERSION=24.5.1 # Set the CLI image name # Support both legacy (govcms8lagoon/govcms8) and newer (govcms/govcms) images. From e6aeed079fb773627f331d868dc4c8b6ee926bdd Mon Sep 17 00:00:00 2001 From: Stuart Rowlands <1256274+stooit@users.noreply.github.com> Date: Wed, 26 Jun 2024 18:34:27 +1000 Subject: [PATCH 08/11] Hotfix release: 3.13.1 GovCMS version. (#409) --- .env.default | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.env.default b/.env.default index fcf70fff5..a9cdd3460 100644 --- a/.env.default +++ b/.env.default @@ -35,7 +35,7 @@ X_FRAME_OPTIONS=SAMEORIGIN # Set the version of GovCMS and Drupal Core to use - you can use a tag or branch reference (3.x-dev) here # See https://github.com/govCMS/GovCMS/releases -GOVCMS_PROJECT_VERSION=3.13.0 +GOVCMS_PROJECT_VERSION=3.13.1 # Set the Lagoon tag to use for the upstream dockerfiles (e.g. 20.12.0) # See https://github.com/uselagoon/lagoon-images/releases From 0bfec59b180e6860a2e99eaf62513e85ba0b2fbe Mon Sep 17 00:00:00 2001 From: ruwanl Date: Fri, 28 Jun 2024 12:20:34 +1000 Subject: [PATCH 09/11] Update .env.default --- .env.default | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.env.default b/.env.default index 3b95251e7..0333ad126 100644 --- a/.env.default +++ b/.env.default @@ -35,11 +35,11 @@ X_FRAME_OPTIONS=SAMEORIGIN # Set the version of GovCMS and Drupal Core to use - you can use a tag or branch reference (3.x-dev) here # See https://github.com/govCMS/GovCMS/releases -GOVCMS_PROJECT_VERSION=dev-release/3.x/3.13.1 +GOVCMS_PROJECT_VERSION=dev-release/3.x/3.14 # Set the Lagoon tag to use for the upstream dockerfiles (e.g. 20.12.0) # See https://github.com/uselagoon/lagoon-images/releases -LAGOON_IMAGE_VERSION=24.5.1 +LAGOON_IMAGE_VERSION=24.6.0 # Set the CLI image name # Support both legacy (govcms8lagoon/govcms8) and newer (govcms/govcms) images. From 38a680ba85ff8e747d2ef982e8eb9ef656e21967 Mon Sep 17 00:00:00 2001 From: ruwanl Date: Fri, 28 Jun 2024 12:37:02 +1000 Subject: [PATCH 10/11] Update .env.default --- .env.default | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.env.default b/.env.default index 0333ad126..06c1fa97b 100644 --- a/.env.default +++ b/.env.default @@ -35,7 +35,7 @@ X_FRAME_OPTIONS=SAMEORIGIN # Set the version of GovCMS and Drupal Core to use - you can use a tag or branch reference (3.x-dev) here # See https://github.com/govCMS/GovCMS/releases -GOVCMS_PROJECT_VERSION=dev-release/3.x/3.14 +GOVCMS_PROJECT_VERSION=dev-release/3.x/3.14.0 # Set the Lagoon tag to use for the upstream dockerfiles (e.g. 20.12.0) # See https://github.com/uselagoon/lagoon-images/releases From 375a4a48c5285b62ced5fd5ec9fa4da9a5f9f8e3 Mon Sep 17 00:00:00 2001 From: Ruwan Date: Mon, 1 Jul 2024 16:10:53 +1000 Subject: [PATCH 11/11] Update version --- .env.default | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.env.default b/.env.default index 06c1fa97b..39c80627e 100644 --- a/.env.default +++ b/.env.default @@ -35,7 +35,7 @@ X_FRAME_OPTIONS=SAMEORIGIN # Set the version of GovCMS and Drupal Core to use - you can use a tag or branch reference (3.x-dev) here # See https://github.com/govCMS/GovCMS/releases -GOVCMS_PROJECT_VERSION=dev-release/3.x/3.14.0 +GOVCMS_PROJECT_VERSION=3.14.0 # Set the Lagoon tag to use for the upstream dockerfiles (e.g. 20.12.0) # See https://github.com/uselagoon/lagoon-images/releases