From 70455556adfa6fbfaf58e20121833e6e8d4b2c42 Mon Sep 17 00:00:00 2001 From: Don Richards <2738244+DonRichards@users.noreply.github.com> Date: Thu, 16 Mar 2023 13:59:08 -0400 Subject: [PATCH 1/8] Adds the "run as" part of the command --- Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 681c9f49a..14b44c837 100644 --- a/Makefile +++ b/Makefile @@ -148,7 +148,7 @@ local: generate-secrets fi $(MAKE) set-files-owner SRC=$(CURDIR)/codebase ENVIRONMENT=local docker-compose up -d --remove-orphans - docker-compose exec -T drupal with-contenv bash -lc 'composer install; chown -R nginx:nginx .' + docker-compose exec -T drupal with-contenv bash -lc "su nginx -s /bin/bash -c 'composer install'; chown -R nginx:nginx ." $(MAKE) remove_standard_profile_references_from_config drupal-database update-settings-php ENVIRONMENT=local docker-compose exec -T drupal with-contenv bash -lc "drush si -y islandora_install_profile_demo --account-pass $(shell cat secrets/live/DRUPAL_DEFAULT_ACCOUNT_PASSWORD)" $(MAKE) delete-shortcut-entities && docker-compose exec -T drupal with-contenv bash -lc "drush pm:un -y shortcut" @@ -185,7 +185,7 @@ starter_dev: generate-secrets fi $(MAKE) set-files-owner SRC=$(CURDIR)/codebase ENVIRONMENT=starter_dev docker-compose up -d --remove-orphans - docker-compose exec -T drupal with-contenv bash -lc 'composer install' + docker-compose exec -T drupal with-contenv bash -lc "su nginx -s /bin/bash -c 'composer install'" $(MAKE) starter-finalize ENVIRONMENT=starter_dev @@ -309,7 +309,7 @@ download-default-certs: # Run Composer Update in your Drupal container composer_update: - docker-compose exec -T drupal with-contenv bash -lc 'composer update' + docker-compose exec -T drupal with-contenv bash -lc su nginx -s /bin/bash -c 'composer update'" reindex-fcrepo-metadata: From a2c04c6cef3bb15297c2186bbcf95a88f064d116 Mon Sep 17 00:00:00 2001 From: Don Richards <2738244+DonRichards@users.noreply.github.com> Date: Fri, 21 Apr 2023 11:10:43 -0400 Subject: [PATCH 2/8] Update Makefile Co-authored-by: Chris Burgess --- Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 14b44c837..9d9182e3f 100644 --- a/Makefile +++ b/Makefile @@ -148,7 +148,8 @@ local: generate-secrets fi $(MAKE) set-files-owner SRC=$(CURDIR)/codebase ENVIRONMENT=local docker-compose up -d --remove-orphans - docker-compose exec -T drupal with-contenv bash -lc "su nginx -s /bin/bash -c 'composer install'; chown -R nginx:nginx ." + docker-compose exec --user nginx -T drupal with-contenv bash -lc "composer install" + docker-compose exec -T drupal with-contenv bash -lc "chown -R nginx:nginx ." $(MAKE) remove_standard_profile_references_from_config drupal-database update-settings-php ENVIRONMENT=local docker-compose exec -T drupal with-contenv bash -lc "drush si -y islandora_install_profile_demo --account-pass $(shell cat secrets/live/DRUPAL_DEFAULT_ACCOUNT_PASSWORD)" $(MAKE) delete-shortcut-entities && docker-compose exec -T drupal with-contenv bash -lc "drush pm:un -y shortcut" From 2d58fcbbf237f0e1b4c43b930a52de97448fefa2 Mon Sep 17 00:00:00 2001 From: Don Richards <2738244+DonRichards@users.noreply.github.com> Date: Fri, 21 Apr 2023 11:10:52 -0400 Subject: [PATCH 3/8] Update Makefile Co-authored-by: Chris Burgess --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 9d9182e3f..8419e24ba 100644 --- a/Makefile +++ b/Makefile @@ -186,7 +186,7 @@ starter_dev: generate-secrets fi $(MAKE) set-files-owner SRC=$(CURDIR)/codebase ENVIRONMENT=starter_dev docker-compose up -d --remove-orphans - docker-compose exec -T drupal with-contenv bash -lc "su nginx -s /bin/bash -c 'composer install'" + docker-compose exec --user nginx -T drupal with-contenv bash -lc "composer install" $(MAKE) starter-finalize ENVIRONMENT=starter_dev From 8ecfa840b0214a9038428a0946dee97fb56949b5 Mon Sep 17 00:00:00 2001 From: Don Richards <2738244+DonRichards@users.noreply.github.com> Date: Wed, 10 May 2023 15:54:56 -0400 Subject: [PATCH 4/8] Update Makefile Revert running as nginx --- Makefile | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 8419e24ba..53aaccdb0 100644 --- a/Makefile +++ b/Makefile @@ -148,8 +148,7 @@ local: generate-secrets fi $(MAKE) set-files-owner SRC=$(CURDIR)/codebase ENVIRONMENT=local docker-compose up -d --remove-orphans - docker-compose exec --user nginx -T drupal with-contenv bash -lc "composer install" - docker-compose exec -T drupal with-contenv bash -lc "chown -R nginx:nginx ." + docker-compose exec -T drupal with-contenv bash -lc "chown -R nginx:nginx . ; su nginx -s /bin/bash -c 'composer install'" $(MAKE) remove_standard_profile_references_from_config drupal-database update-settings-php ENVIRONMENT=local docker-compose exec -T drupal with-contenv bash -lc "drush si -y islandora_install_profile_demo --account-pass $(shell cat secrets/live/DRUPAL_DEFAULT_ACCOUNT_PASSWORD)" $(MAKE) delete-shortcut-entities && docker-compose exec -T drupal with-contenv bash -lc "drush pm:un -y shortcut" @@ -186,7 +185,7 @@ starter_dev: generate-secrets fi $(MAKE) set-files-owner SRC=$(CURDIR)/codebase ENVIRONMENT=starter_dev docker-compose up -d --remove-orphans - docker-compose exec --user nginx -T drupal with-contenv bash -lc "composer install" + docker-compose exec -T drupal with-contenv bash -lc "chown -R nginx:nginx . ; su nginx -s /bin/bash -c 'composer install'" $(MAKE) starter-finalize ENVIRONMENT=starter_dev From 40f33812b27e24cfa9f639619e66e444792e5e0a Mon Sep 17 00:00:00 2001 From: Don Richards <2738244+DonRichards@users.noreply.github.com> Date: Wed, 24 May 2023 13:59:52 -0400 Subject: [PATCH 5/8] fix typo --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 53aaccdb0..ecd9281a8 100644 --- a/Makefile +++ b/Makefile @@ -309,7 +309,7 @@ download-default-certs: # Run Composer Update in your Drupal container composer_update: - docker-compose exec -T drupal with-contenv bash -lc su nginx -s /bin/bash -c 'composer update'" + docker-compose exec -T drupal with-contenv bash -lc su nginx -s /bin/bash -c "composer update" reindex-fcrepo-metadata: From 417059ae049f29c9416453c15ca6097fe6d23d3c Mon Sep 17 00:00:00 2001 From: Don Richards <2738244+DonRichards@users.noreply.github.com> Date: Wed, 27 Sep 2023 16:45:29 -0400 Subject: [PATCH 6/8] Add wait for /var/www/drupal --- Makefile | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index ff5dff2c9..a37c51784 100644 --- a/Makefile +++ b/Makefile @@ -148,7 +148,12 @@ local: generate-secrets fi $(MAKE) set-files-owner SRC=$(CURDIR)/codebase ENVIRONMENT=local docker-compose up -d --remove-orphans - docker-compose exec -T drupal with-contenv bash -lc "chown -R nginx:nginx . ; su nginx -s /bin/bash -c 'composer install'" + @echo "Wait for the /var/www/drupal directory to be available" + while ! docker-compose exec -T drupal with-contenv bash -lc 'test -d /var/www/drupal'; do \ + echo "Waiting for /var/www/drupal directory to be available..."; \ + sleep 2; \ + done + docker-compose exec -T drupal with-contenv bash -lc 'chown -R nginx:nginx /var/www/drupal/ && su nginx -s /bin/bash -c "composer install"' $(MAKE) remove_standard_profile_references_from_config drupal-database update-settings-php ENVIRONMENT=local docker compose exec -T drupal with-contenv bash -lc "drush si -y islandora_install_profile_demo --account-pass '$(shell cat secrets/live/DRUPAL_DEFAULT_ACCOUNT_PASSWORD)'" $(MAKE) delete-shortcut-entities && docker compose exec -T drupal with-contenv bash -lc "drush pm:un -y shortcut" @@ -187,7 +192,12 @@ starter_dev: generate-secrets fi $(MAKE) set-files-owner SRC=$(CURDIR)/codebase ENVIRONMENT=starter_dev docker-compose up -d --remove-orphans - docker-compose exec -T drupal with-contenv bash -lc "chown -R nginx:nginx . ; su nginx -s /bin/bash -c 'composer install'" + @echo "Wait for the /var/www/drupal directory to be available" + while ! docker-compose exec -T drupal with-contenv bash -lc 'test -d /var/www/drupal'; do \ + echo "Waiting for /var/www/drupal directory to be available..."; \ + sleep 2; \ + done + docker-compose exec -T drupal with-contenv bash -lc 'chown -R nginx:nginx /var/www/drupal/ && su nginx -s /bin/bash -c "composer install"' $(MAKE) starter-finalize ENVIRONMENT=starter_dev From 4efb87cb92ce9b65d36f336ca974303b8d66bbd6 Mon Sep 17 00:00:00 2001 From: Don Richards <2738244+DonRichards@users.noreply.github.com> Date: Wed, 27 Sep 2023 17:10:57 -0400 Subject: [PATCH 7/8] Removed hyphens in docker compose --- Makefile | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index a37c51784..472e1f77d 100644 --- a/Makefile +++ b/Makefile @@ -149,11 +149,11 @@ local: generate-secrets $(MAKE) set-files-owner SRC=$(CURDIR)/codebase ENVIRONMENT=local docker-compose up -d --remove-orphans @echo "Wait for the /var/www/drupal directory to be available" - while ! docker-compose exec -T drupal with-contenv bash -lc 'test -d /var/www/drupal'; do \ + while ! docker compose exec -T drupal with-contenv bash -lc 'test -d /var/www/drupal'; do \ echo "Waiting for /var/www/drupal directory to be available..."; \ sleep 2; \ done - docker-compose exec -T drupal with-contenv bash -lc 'chown -R nginx:nginx /var/www/drupal/ && su nginx -s /bin/bash -c "composer install"' + docker compose exec -T drupal with-contenv bash -lc 'chown -R nginx:nginx /var/www/drupal/ && su nginx -s /bin/bash -c "composer install"' $(MAKE) remove_standard_profile_references_from_config drupal-database update-settings-php ENVIRONMENT=local docker compose exec -T drupal with-contenv bash -lc "drush si -y islandora_install_profile_demo --account-pass '$(shell cat secrets/live/DRUPAL_DEFAULT_ACCOUNT_PASSWORD)'" $(MAKE) delete-shortcut-entities && docker compose exec -T drupal with-contenv bash -lc "drush pm:un -y shortcut" @@ -193,11 +193,11 @@ starter_dev: generate-secrets $(MAKE) set-files-owner SRC=$(CURDIR)/codebase ENVIRONMENT=starter_dev docker-compose up -d --remove-orphans @echo "Wait for the /var/www/drupal directory to be available" - while ! docker-compose exec -T drupal with-contenv bash -lc 'test -d /var/www/drupal'; do \ + while ! docker compose exec -T drupal with-contenv bash -lc 'test -d /var/www/drupal'; do \ echo "Waiting for /var/www/drupal directory to be available..."; \ sleep 2; \ done - docker-compose exec -T drupal with-contenv bash -lc 'chown -R nginx:nginx /var/www/drupal/ && su nginx -s /bin/bash -c "composer install"' + docker compose exec -T drupal with-contenv bash -lc 'chown -R nginx:nginx /var/www/drupal/ && su nginx -s /bin/bash -c "composer install"' $(MAKE) starter-finalize ENVIRONMENT=starter_dev @@ -342,7 +342,7 @@ download-default-certs: # Run Composer Update in your Drupal container composer_update: - docker-compose exec -T drupal with-contenv bash -lc su nginx -s /bin/bash -c "composer update" + docker compose exec -T drupal with-contenv bash -lc su nginx -s /bin/bash -c "composer update" reindex-fcrepo-metadata: From fde8c8233318339022a049144c27095e9a95122e Mon Sep 17 00:00:00 2001 From: Don Richards <2738244+DonRichards@users.noreply.github.com> Date: Wed, 27 Sep 2023 17:12:26 -0400 Subject: [PATCH 8/8] Additional hyphens missed in docker compose --- Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 472e1f77d..c317fe56f 100644 --- a/Makefile +++ b/Makefile @@ -147,7 +147,7 @@ local: generate-secrets docker container run --rm -v $(CURDIR)/codebase:/home/root $(REPOSITORY)/nginx:$(TAG) with-contenv bash -lc 'git clone -b main https://github.com/islandora-devops/islandora-sandbox /tmp/codebase; mv /tmp/codebase/* /home/root;'; \ fi $(MAKE) set-files-owner SRC=$(CURDIR)/codebase ENVIRONMENT=local - docker-compose up -d --remove-orphans + docker compose up -d --remove-orphans @echo "Wait for the /var/www/drupal directory to be available" while ! docker compose exec -T drupal with-contenv bash -lc 'test -d /var/www/drupal'; do \ echo "Waiting for /var/www/drupal directory to be available..."; \ @@ -191,7 +191,7 @@ starter_dev: generate-secrets docker container run --rm -v $(CURDIR)/codebase:/home/root $(REPOSITORY)/nginx:$(TAG) with-contenv bash -lc 'git clone -b main https://github.com/Islandora-Devops/islandora-starter-site /home/root;'; \ fi $(MAKE) set-files-owner SRC=$(CURDIR)/codebase ENVIRONMENT=starter_dev - docker-compose up -d --remove-orphans + docker compose up -d --remove-orphans @echo "Wait for the /var/www/drupal directory to be available" while ! docker compose exec -T drupal with-contenv bash -lc 'test -d /var/www/drupal'; do \ echo "Waiting for /var/www/drupal directory to be available..."; \ @@ -431,7 +431,7 @@ ifndef DEST $(error DEST is not set) endif docker compose exec -T drupal with-contenv bash -lc 'tar zcvf /tmp/public-files.tgz -C /var/www/drupal/web/sites/default/files ${PUBLIC_FILES_TAR_DUMP_PATH}' - docker cp $$(docker-compose ps -q drupal):/tmp/public-files.tgz $(DEST) + docker cp $$(docker compose ps -q drupal):/tmp/public-files.tgz $(DEST) # import Drupal's public files from zipped tarball