change: www volume managed better

This commit is contained in:
mcolonna 2025-06-13 12:26:40 +02:00
parent 49a136c709
commit f5c5b31fbd
7 changed files with 43 additions and 38 deletions

View file

@ -9,7 +9,7 @@ SRC_WWW_MORE=srcs/www/
.ONESHELL :
.SHELLFLAGS = -eu -c
.PHONY : run install uninstall debug re help shell
.PHONY : run uninstall debug re help shell
### pretty logs ####
@ -23,7 +23,7 @@ _ECHO = echoo(){ \
## Run the compose.
run : $(WWW_PATH)
run :
@$(_ECHO)
echoo "Running '$(SRC_COMPOSE)'..."
@ -31,31 +31,6 @@ run : $(WWW_PATH)
INCEPTION_WWW_PATH="$(shell realpath $(WWW_PATH))" $(DOCKER) compose up --build
## Create WWW_PATH from wordpress' release.
install : $(WWW_PATH)
$(WWW_PATH) :
@$(_ECHO)
echoo "Creating $(WWW_PATH) directory from wordpress release..."
rm -rf $(BUILD_PATH)
# download and uncompress release
mkdir -p $(BUILD_PATH)"/www/"
curl https://wordpress.org/latest.tar.gz | tar zx -C $(BUILD_PATH)/www
# move in WWW_PATH
rm -rf -- $(WWW_PATH)
mv $(BUILD_PATH)"/www/wordpress" $(WWW_PATH)
echo
echo "also copy files from $(SRC_WWW_MORE)"
cp -r $(SRC_WWW_MORE)/. $(WWW_PATH)
rm -rf $(BUILD_PATH)
## Remove WWW_PATH.
uninstall :
@$(_ECHO)
@ -66,10 +41,11 @@ uninstall :
# TODO(ugly)
-docker container prune
-docker volume rm my-awesome-compose_db
-docker volume rm my-awesome-compose_www
## 'uninstall' then 'install'
re : uninstall install
re : uninstall run
@$(_ECHO)
echo
echo "run \`make\` or \`make run\` to run the docker."
@ -90,9 +66,8 @@ help :
echo
echo "run Run the compose, install WWW_PATH if necessary."
echo "install Create WWW_PATH from wordpress' release."
echo "uninstall Remove WWW_PATH."
echo "re 'uninstall' then 'install'."
echo "uninstall TODO"
echo "re 'uninstall' then 'run'."
# TODO docs shell
echo
echo "WWW_PATH is the volume directory where WordPress is installed."