diff --git a/custom.Makefile b/custom.Makefile index 4186213f5..c006d7b68 100644 --- a/custom.Makefile +++ b/custom.Makefile @@ -123,7 +123,13 @@ jhu_up: jhu_generate-secrets docker-compose up -d --remove-orphans docker-compose exec -T drupal with-contenv bash -lc 'git config --global --add safe.directory /var/www/drupal/web/modules/contrib/islandora_fits' # The rest of this should be moved into another function. - docker-compose exec -T drupal with-contenv bash -lc 'rm -rf vendor/ web/modules/contrib/* web/themes/contrib/* ; 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 'rm -rf vendor/ web/modules/contrib/* web/themes/contrib/*' + 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) set-codebase-owner docker-compose exec -T drupal with-contenv bash -lc 'chown -R nginx:nginx .' $(MAKE) drupal-database update-settings-php @@ -236,7 +242,12 @@ jhu_config_export: ## JHU: Imports the sites configuration. jhu_config_import: $(MAKE) set-codebase-owner - docker-compose exec drupal with-contenv bash -lc "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"' docker-compose exec drupal with-contenv bash -lc "chown -R nginx: /var/www/drupal/config/sync/" docker-compose exec -T drupal drush -l $(SITE) config:import -y --debug $(MAKE) set-codebase-owner