diff --git a/.editorconfig b/.editorconfig index 91413295..c355e03f 100644 --- a/.editorconfig +++ b/.editorconfig @@ -6,3 +6,6 @@ insert_final_newline = true charset = utf-8 indent_style = space indent_size = 4 + +[Makefile] +indent_style = tab diff --git a/Makefile b/Makefile new file mode 100644 index 00000000..e03f67fa --- /dev/null +++ b/Makefile @@ -0,0 +1,52 @@ +PHP_EXE := $(shell which php8.4) +COMPOSER_EXE := $(shell which composer) +NODE_EXE := $(shell which node) +NPM_EXE := $(shell which npm) +SUDO_EXE := $(shell which sudo) +GIT_EXE := $(shell which git) + +WWW_USER := www-data +BUILD_EXE := build.js +ENV_FILE := .env +TOOLS_DIR := tools +VENDOR_DIR := vendor + +all: update migrate clear-cache build cron + +update: composer npm + +composer: + ${PHP_EXE} ${COMPOSER_EXE} update + +npm: + ${NPM_EXE} update --save + +migrate: + ${SUDO_EXE} -u ${WWW_USER} ${PHP_EXE} ${TOOLS_DIR}/migrate + +clear-cache: + ${SUDO_EXE} -u ${WWW_USER} ${PHP_EXE} ${TOOLS_DIR}/nuke-tpl-cache + +cron: + ${SUDO_EXE} -u ${WWW_USER} ${PHP_EXE} ${TOOLS_DIR}/cron slow + +build: + ${NODE_EXE} --env-file ${ENV_FILE} ${BUILD_EXE} + +rebuild-css: + ${NODE_EXE} --env-file ${ENV_FILE} ${BUILD_EXE} css + +rebuild-js: + ${NODE_EXE} --env-file ${ENV_FILE} ${BUILD_EXE} js + +rebuild-twig: + ${NODE_EXE} --env-file ${ENV_FILE} ${BUILD_EXE} twig + +analyse: + ${PHP_EXE} ${VENDOR_DIR}/bin/phpstan + +tag: analyse + ${PHP_EXE} ${TOOLS_DIR}/create-tag + ${GIT_EXE} push + +.PHONY: all update composer npm build rebuild-css rebuild-js rebuild-twig migrate clear-cache cron analyse tag diff --git a/VERSION b/VERSION index 4ce4ddb0..534b600c 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -20250403.2 +20250411 diff --git a/composer.json b/composer.json index 611ea43e..86d431cc 100644 --- a/composer.json +++ b/composer.json @@ -22,12 +22,6 @@ "Misuzu\\": "src" } }, - "scripts": { - "post-install-cmd": [ - "./tools/migrate", - "./tools/cron slow" - ] - }, "require-dev": { "phpstan/phpstan": "~2.1" }