Skip to content

Commit

Permalink
Make public/bundles/nelmioapidoc a real target, during build
Browse files Browse the repository at this point in the history
This makes sure it is copied (locally, in the source tree)
as the current user, preventing permission issues cleaning it
up again. During install it is copied with everything else to
the target tree.

By making it a real, non-PHONY target, it does not get recreated
again during `make install-docs`, which could then also likely
be with root ownership.
  • Loading branch information
eldering committed Sep 19, 2024
1 parent 430db87 commit 8e746e7
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions webapp/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ include $(TOPDIR)/Makefile.global
# Subdirectories to recurse into for REC_TARGETS
SUBDIRS = config

domserver: composer-dump-autoload
domserver: composer-dump-autoload public/bundles/nelmioapidoc

# Install PHP dependencies
composer-dependencies:
Expand Down Expand Up @@ -43,10 +43,11 @@ composer-dump-autoload-dev:
@echo "# the DOMjudge Symfony application in developer mode. Adjust as needed." >> $@
@echo "APP_ENV=dev" >> $@

copy-bundle-assets:
public/bundles/nelmioapidoc:
# This must be copied first to later install with the rest, do this
# during build time, so that the files have the right permissions.
# We can not use bin/console here, as when using a fakeroot,
# the include paths are broken. We just copy in the data we need
-rm -rf public/bundles/nelmioapidoc
# the include paths are broken. We just copy in the data we need.
mkdir -p public/bundles/nelmioapidoc
cp -R vendor/nelmio/api-doc-bundle/public/* public/bundles/nelmioapidoc/

Expand All @@ -55,8 +56,6 @@ clean-l:
-rm -f vendor/autoload_runtime.php

install-domserver:
# This must be done first to install with the rest.
$(MAKE) copy-bundle-assets
$(INSTALL_DIR) $(DESTDIR)$(domserver_webappdir);
for d in bin config migrations public resources src templates tests vendor; do \
$(call install_tree,$(DESTDIR)$(domserver_webappdir),$$d) ; \
Expand Down Expand Up @@ -86,5 +85,4 @@ maintainer-clean-l:
done ; \
done

.PHONY: composer-dump-autoload composer-dump-autoload-dev \
copy-bundle-assets
.PHONY: composer-dump-autoload composer-dump-autoload-dev

0 comments on commit 8e746e7

Please sign in to comment.