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

Add set-codebase-owner function #320

Open
wants to merge 7 commits into
base: development
Choose a base branch
from
Open
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
20 changes: 20 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,25 @@ download-default-certs:
composer_update:
docker-compose exec -T drupal with-contenv bash -lc 'composer update'

.PHONY: set-codebase-owner
.SILENT: set-codebase-owner
## JHU: Updates codebase folder to be owned by the host user and nginx group.
set-codebase-owner:
@echo ""
@echo "Setting codebase/ folder owner back to $(shell id -u):101"
if [ -n "$$(docker ps -q -f name=drupal)" ]; then \
echo " └─ Using docker-compose codebase/ directory"; \
docker-compose exec -T drupal with-contenv bash -lc "find . -not -user $(shell id -u) -not -path '*/sites/default/files' -exec chown $(shell id -u):101 {} \;" ; \
docker-compose exec -T drupal with-contenv bash -lc "find . -not -group 101 -not -path '*/sites/default/files' -exec chown $(shell id -u):101 {} \;" ; \
elif [ -d "codebase" ]; then \
echo " └─ Using local codebase/ directory"; \
sudo find ./codebase -not -user $(shell id -u) -not -path '*/sites/default/files' -exec chown $(shell id -u):101 {} \; ; \
sudo find ./codebase -not -group 101 -not -path '*/sites/default/files' -exec chown $(shell id -u):101 {} \; ; \
else \
echo " └─ No codebase/ directory found, skipping"; \
fi
@echo " └─ Done"
@echo ""

reindex-fcrepo-metadata:
# Re-index RDF in Fedora
Expand Down Expand Up @@ -381,6 +400,7 @@ endif
.SILENT: config-export
## Exports the sites configuration.
config-export:
$(MAKE) set-codebase-owner
docker-compose exec -T drupal drush -l $(SITE) config:export -y


Expand Down