Skip to content

Commit

Permalink
Merge pull request #329 from Islandora-Devops/force_composer_as_nginx
Browse files Browse the repository at this point in the history
Run composer commands as nginx
  • Loading branch information
aOelschlager authored Sep 27, 2023
2 parents 7ef18bb + fde8c82 commit ead1d61
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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 'composer install; chown -R nginx:nginx .'
@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"
Expand Down Expand Up @@ -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 '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


Expand Down Expand Up @@ -332,7 +342,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:
Expand Down Expand Up @@ -421,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
Expand Down

0 comments on commit ead1d61

Please sign in to comment.