Skip to content

Commit

Permalink
Fixing nasty OSX bug where docker mount root dir
Browse files Browse the repository at this point in the history
  • Loading branch information
davidferlay committed Apr 29, 2022
1 parent 75d3972 commit a85c49d
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
1 change: 0 additions & 1 deletion .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ sniffers:compose:
stage: sniffers
script:
- composer -vvv -V
# Can't use --strict cause we need dev versions for d9 compatibility
- time composer validate --profile
only:
- branches
Expand Down
9 changes: 6 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ ifneq ("$(wildcard settings/settings.local.php)","")
$(call php, drush cr)
endif

REDIS_IS_INSTALLED := $(shell grep "redis.connection" web/sites/default/settings.php | tail -1 | wc -l || echo "0")
REDIS_IS_INSTALLED := $(shell grep "redis.connection" web/sites/default/settings.php 2> /dev/null | tail -1 | wc -l || echo "0")
redis-settings:
ifeq ($(REDIS_IS_INSTALLED), 1)
@echo "Redis settings already installed, nothing to do"
Expand Down Expand Up @@ -200,8 +200,11 @@ DIRS = web/core web/libraries web/modules/contrib web/profiles/contrib web/sites
## Totally remove project build folder, docker containers and network
clean: info
make -s down
$(eval SCAFFOLD = $(shell docker run --rm -v $(CURDIR):/mnt -w /mnt --user $(CUID):$(CGID) $(IMAGE_PHP) composer run-script list-scaffold-files | grep -P '^(?!>)'))
@docker run --rm --user 0:0 -v $(CURDIR):/mnt -w /mnt -e RMLIST="$(addprefix web/,$(SCAFFOLD)) $(DIRS)" $(IMAGE_PHP) sh -c 'for i in $$RMLIST; do rm -fr $$i && echo "Removed $$i"; done'
ifdef CURDIR
@echo "CURDIR=$(CURDIR)"
#$(eval SCAFFOLD = $(shell docker run --rm -v $(CURDIR):/mnt -w /mnt --user $(CUID):$(CGID) $(IMAGE_PHP) composer run-script list-scaffold-files | grep -P '^(?!>)'))
#@docker run --rm --user 0:0 -v $(CURDIR):/mnt -w /mnt -e RMLIST="$(addprefix web/,$(SCAFFOLD)) $(DIRS)" $(IMAGE_PHP) sh -c 'for i in $$RMLIST; do rm -fr $$i && echo "Removed $$i"; done'
endif
ifdef DB_MOUNT_DIR
@echo "Clean-up database data from $(DB_MOUNT_DIR) ..."
docker run --rm --user 0:0 -v $(shell dirname $(DB_MOUNT_DIR)):/mnt $(IMAGE_PHP) sh -c "rm -fr /mnt/`basename $(DB_MOUNT_DIR)`"
Expand Down
6 changes: 5 additions & 1 deletion scripts/makefile/system-detection.mk
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,11 @@ else
SYSTEM_OS = 'LINUX'
endif
ifeq ($(UNAME_S),Darwin)
SYSTEM_OS = 'OS_X'
SYSTEM_OS = 'OS_X'
CUID=1000
CGID=1000
PHP_VERSION=7
COMPOSE_HTTP_TIMEOUT=1024
endif
UNAME_P := $(shell uname -p)
ifeq ($(UNAME_P),x86_64)
Expand Down

0 comments on commit a85c49d

Please sign in to comment.