dev: clean and fix Makefile
This commit is contained in:
parent
2eb686ef41
commit
2d673aa016
1 changed files with 14 additions and 30 deletions
44
Makefile
44
Makefile
|
@ -1,6 +1,5 @@
|
||||||
# TODO(vm) data is supposed to be in $HOME/data/
|
# TODO(vm) data is supposed to be in $HOME/data/
|
||||||
|
|
||||||
WWW_PATH=__www/ # TODO to change
|
|
||||||
BUILD_PATH=__build/
|
BUILD_PATH=__build/
|
||||||
|
|
||||||
DOCKER=docker
|
DOCKER=docker
|
||||||
|
@ -9,7 +8,7 @@ SRC_WWW_MORE=srcs/www/
|
||||||
|
|
||||||
.ONESHELL :
|
.ONESHELL :
|
||||||
.SHELLFLAGS = -eu -c
|
.SHELLFLAGS = -eu -c
|
||||||
.PHONY : run uninstall debug re help shell
|
.PHONY : run reset re help
|
||||||
|
|
||||||
### pretty logs ####
|
### pretty logs ####
|
||||||
|
|
||||||
|
@ -28,48 +27,33 @@ run :
|
||||||
|
|
||||||
echoo "Running '$(SRC_COMPOSE)'..."
|
echoo "Running '$(SRC_COMPOSE)'..."
|
||||||
cd -- $(SRC_COMPOSE)
|
cd -- $(SRC_COMPOSE)
|
||||||
INCEPTION_WWW_PATH="$(shell realpath $(WWW_PATH))" $(DOCKER) compose up --build
|
$(DOCKER) compose up --build
|
||||||
|
cd -
|
||||||
|
|
||||||
|
|
||||||
## Remove WWW_PATH.
|
## Remove all content of the website.
|
||||||
uninstall :
|
reset :
|
||||||
@$(_ECHO)
|
@$(_ECHO)
|
||||||
|
|
||||||
echoo "Removing $(WWW_PATH)..."
|
echoo "Removing all data..."
|
||||||
rm -r $(WWW_PATH) || true
|
cd -- $(SRC_COMPOSE)
|
||||||
|
docker compose down -v
|
||||||
# TODO(ugly)
|
cd -
|
||||||
docker container prune
|
|
||||||
docker volume rm my-awesome-compose_db || true
|
|
||||||
docker volume rm my-awesome-compose_www || true
|
|
||||||
|
|
||||||
|
|
||||||
## 'uninstall' then 'install'
|
## 'reset' then 'run'
|
||||||
re : uninstall run
|
re : reset run
|
||||||
@$(_ECHO)
|
@$(_ECHO)
|
||||||
echo
|
echo
|
||||||
echo "run \`make\` or \`make run\` to run the docker."
|
echo "run \`make\` or \`make run\` to run the docker."
|
||||||
|
|
||||||
|
|
||||||
## TODO docs
|
|
||||||
shell :
|
|
||||||
@$(_ECHO)
|
|
||||||
|
|
||||||
echoo "Running shell inside '$(SRC_COMPOSE)' (container nginx)..."
|
|
||||||
cd -- $(SRC_COMPOSE)
|
|
||||||
INCEPTION_WWW_PATH="$(shell realpath $(WWW_PATH))" $(DOCKER) compose run --build nginx sh
|
|
||||||
|
|
||||||
|
|
||||||
## Show help
|
## Show help
|
||||||
help :
|
help :
|
||||||
@$(_ECHO)
|
@$(_ECHO)
|
||||||
|
|
||||||
echo
|
echo
|
||||||
echo "run Run the compose, install WWW_PATH if necessary."
|
echo "run Run the compose."
|
||||||
echo "uninstall TODO"
|
echo "reset Remove all content of the website."
|
||||||
echo "re 'uninstall' then 'run'."
|
echo "re 'reset' then 'run'."
|
||||||
# TODO docs shell
|
|
||||||
echo
|
|
||||||
echo "WWW_PATH is the volume directory where WordPress is installed."
|
|
||||||
echo "you might want to reset the WWW_PATH variable in the Makefile."
|
|
||||||
echo
|
echo
|
||||||
|
|
Loading…
Add table
Reference in a new issue