Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run composer commands as nginx #329

Merged
merged 9 commits into from
Sep 27, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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